new Physics()
Default Constructor
Physics engine supporting projection and impulse collision resolution.
- Source:
Methods
getHasMotion() → {boolean}
Return mHasMotion
- Source:
Returns:
mHasMotion
- Type
- boolean
getPositionalCorrection() → {boolean}
Return mCorrectPosition
- Source:
Returns:
mCorrectPosition
- Type
- boolean
getRelaxationCount() → {float}
Return Relaxation Count
- Source:
Returns:
mRelaxationCount
- Type
- float
getSystemtAcceleration() → {Array.<Float>}
Return Acceleration
- Source:
Returns:
Current Acceleration [X, Y]
- Type
- Array.<Float>
incRelaxationCount(dc)
Increment the Relaxation Count
Parameters:
Name | Type | Description |
---|---|---|
dc |
float | The amount you want to increment the count by |
- Source:
positionalCorrection(s1, s2, collisionInfo)
Corrects the position of both colliding objects passed to it
Parameters:
Name | Type | Description |
---|---|---|
s1 |
RigidShape | The first rigid shape |
s2 |
RigidShape | The second rigid shape |
collisionInfo |
CollisionInfo | Used for position correction |
- Source:
processCollision(set, infoSet)
Handles collisions between all objects within the set
Parameters:
Name | Type | Description |
---|---|---|
set |
GameObjectSet | The GameObjetSet that you want to run collision update on |
infoSet |
CollisionInfo | Used to collect all collision info |
- Source:
resolveCollision(s1, s2, collisionInfo)
Updates all of the physics variables of the 2 passed RigidShape
Parameters:
Name | Type | Description |
---|---|---|
s1 |
RigidShape | The first rigid shape |
s2 |
RigidShape | The second rigid shape |
collisionInfo |
CollisionInfo | Used for adjusting physic values |
- Source:
toggleHasMotion()
Sets mHasMotion from true to false or vice versa
- Source:
togglePositionalCorrection()
Sets mCorrectPosition from true to false or vice versa
- Source: