Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
Update CCPhysicsBody.cs
Browse files Browse the repository at this point in the history
Search element only one time
  • Loading branch information
azahmed096 committed Nov 21, 2016
1 parent 11533d8 commit 47e743e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/physics/CCPhysicsBody.cs
Expand Up @@ -224,9 +224,9 @@ public void Update(float delta)

public void RemoveJoint(CCPhysicsJoint joint)
{
var it = _joints.Find((j) => j == joint);
if (it != null)
_joints.Remove(it);
int it = _joints.FindIndex((j) => j == joint);
if (it != -1)
_joints.RemoveAt(it);
}

protected void UpdateDamping() { _isDamping = _linearDamping != 0.0f || _angularDamping != 0.0f; }
Expand Down Expand Up @@ -690,7 +690,7 @@ public void SetCategoryBitmask(int bitmask)
}
/**
* A mask that defines which categories of bodies cause intersection notifications with this physics body.
* When two bodies share the same space, each body’s category mask is tested against the other body’s contact mask by performing a logical AND operation. If either comparison results in a non-zero value, an PhysicsContact object is created and passed to the physics world’s delegate. For best performance, only set bits in the contacts mask for interactions you are interested in.
* When two bodies share the same space, each body’s category mask is tested against the other body’s contact mask by performing a logical AND operation. If either comparison results in a non-zero value, an PhysicsContact object is created and passed to the physics world’s delegate. For best performance, only set bits in the contacts mask for interactions you are interested in.
* The default value is 0x00000000 (all bits cleared).
*/
public void SetContactTestBitmask(int bitmask)
Expand All @@ -704,7 +704,7 @@ public void SetContactTestBitmask(int bitmask)
}
/**
* A mask that defines which categories of physics bodies can collide with this physics body.
* When two physics bodies contact each other, a collision may occur. This body’s collision mask is compared to the other body’s category mask by performing a logical AND operation. If the result is a non-zero value, then this body is affected by the collision. Each body independently chooses whether it wants to be affected by the other body. For example, you might use this to avoid collision calculations that would make negligible changes to a body’s velocity.
* When two physics bodies contact each other, a collision may occur. This body’s collision mask is compared to the other body’s category mask by performing a logical AND operation. If the result is a non-zero value, then this body is affected by the collision. Each body independently chooses whether it wants to be affected by the other body. For example, you might use this to avoid collision calculations that would make negligible changes to a body’s velocity.
* The default value is 0xFFFFFFFF (all bits set).
*/
public void SetCollisionBitmask(int bitmask)
Expand Down Expand Up @@ -1135,7 +1135,7 @@ public void SetRotationEnable(bool enable)
}
}

/** whether this physics body is affected by the physics world’s gravitational force. */
/** whether this physics body is affected by the physics world’s gravitational force. */
public bool IsGravityEnabled() { return _gravityEnabled; }
/** set the body is affected by the physics world's gravitational force or not. */
public void SetGravityEnable(bool enable)
Expand Down Expand Up @@ -1277,4 +1277,4 @@ public void SetCenterOfGravity(cpVect gravity)
}
}
}
#endif
#endif

0 comments on commit 47e743e

Please sign in to comment.