new Physics()
Default Constructor
Physics engine supporting projection and impulse collision resolution.
- Source:
Methods
(static) getHasMotion() → {boolean}
Return mHasMotion
- Source:
Returns:
mHasMotion
- Type
- boolean
(static) getPositionalCorrection() → {boolean}
Return mCorrectPosition
- Source:
Returns:
mCorrectPosition
- Type
- boolean
(static) getRelaxationCount() → {float}
Return Relaxation Count
- Source:
Returns:
mRelaxationCount
- Type
- float
(static) getSystemtAcceleration() → {Array.<Float>}
Return Acceleration
- Source:
Returns:
Current Acceleration [X, Y]
- Type
- Array.<Float>
(static) incRelaxationCount(dc)
Increment the Relaxation Count
Parameters:
Name | Type | Description |
---|---|---|
dc |
float | The amount you want to increment the count by |
- Source:
(static) 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:
(static) 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:
(static) 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:
(static) toggleHasMotion()
Sets mHasMotion from true to false or vice versa
- Source:
(static) togglePositionalCorrection()
Sets mCorrectPosition from true to false or vice versa
- Source: