behdad / box2d

Automatically exported from code.google.com/p/box2d
2 stars 12 forks source link

Documentation error? b2Body::IsAwake() return value #288

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
"bool b2Body::IsAwake () const [inline]
Get the sleeping state of this body.
Returns:
true if the body is sleeping."

from the Box2d documentation file:
Documentation/API/html/classb2_body.html

I can't understand that. it returns true if the body is SLEEPING? shouldn't it 
return true is the body was AWAKE ?

is the documentation wrong ?

I don't know if this is the best place to ask, but if the docummentation is 
really wrong, at least you already know and can fix it later.

PS: i've also checked the source, and it says:
"/// Get the sleeping state of this body.
/// @return true if the body is sleeping.
bool IsAwake() const;"

however, in the ApplyForce() function, i found that:
"if (IsAwake() == false)
{
    SetAwake(true);
}"

if we apply a force to a sleeping body, it will awake .. but the isAwake 
returns TRUE if it's sleeping. I think the code wouldn't work if this was the 
real behaviour of isAwake.

Sorry for my bad english. 

Original issue reported on code.google.com by tylee....@gmail.com on 26 Jul 2012 at 8:13

GoogleCodeExporter commented 9 years ago
Completed: At revision: 261  

Fixed comment.

Original comment by erinca...@gmail.com on 23 Oct 2013 at 6:06

GoogleCodeExporter commented 9 years ago
Issue 294 has been merged into this issue.

Original comment by erinca...@gmail.com on 26 Oct 2013 at 10:43