Class enchant.gl.physics.PhySprite3D
- Defined in: physics.gl.enchant.js
Constructor Attributes | Constructor Name and Description |
---|---|
Physical Sprite.
|
Field Attributes | Field Name and Description |
---|---|
PhySprite3D frictions.
|
|
PhySprite3D restitutions.
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
applyCentralImpulse(powerX, powerY, powerZ)
Add power to rigid body.
|
|
applyImpulse(powerX, powerY, powerZ, positonX, positonY, positonZ)
Add power to rigid body.
|
|
contactTest(sprite)
Collision detection with another PhySprite3D.
|
|
Kinematize Rigid.
|
|
rotationApply(quat)
Rotation line acquired from quaternion is applied in rotation line.
|
|
rotationSet(quat)
Set rotation line acquired from quaternion in rotation line.
|
|
scale(x, y, z)
Expand and contract PhySprite3D.
|
|
translate(x, y, z)
Move PhySprite3D horizontally.
|
Class Detail
enchant.gl.physics.PhySprite3D(rigid)
Physical Sprite.
If you add to PhySprite3D, physical calculation will be applied when stepSimulation is called up.
- Parameters:
- {enchant.gl.physics.Rigid} rigid
Field Detail
{Number}
friction
PhySprite3D frictions.
{Number}
restitution
PhySprite3D restitutions.
Method Detail
-
applyCentralImpulse(powerX, powerY, powerZ)Add power to rigid body. Power is added to center of rigid body.
- Parameters:
- {Number} powerX
- Power on x axis.
- {Number} powerY
- Power on y axis.
- {Number} powerZ
- Power on z axis.
-
applyImpulse(powerX, powerY, powerZ, positonX, positonY, positonZ)Add power to rigid body. Power is added to designated position.
- Parameters:
- {Number} powerX
- x axis power.
- {Number} powerY
- y axis power.
- {Number} powerZ
- z axis power.
- {Number} positonX
- x coordinates to which power is added.
- {Number} positonY
- y coordinates to which power is added.
- {Number} positonZ
- z coordinates to which power is added.
-
clearForces()
-
{Boolean} contactTest(sprite)Collision detection with another PhySprite3D.
- Parameters:
- {enchant.gl.physics.PhySprite3D} sprite
- PhySprite3D to be detected.
- Returns:
- {Boolean} bool Presence or absence of collision.
-
kinematize()Kinematize Rigid.
-
rotationApply(quat)Rotation line acquired from quaternion is applied in rotation line. Posture in World will also be changed.
- Parameters:
- {enchant.gl.Quat} quat
-
rotationSet(quat)Set rotation line acquired from quaternion in rotation line. Posture in World will also be changed.
- Parameters:
- {enchant.gl.Quat} quat
-
scale(x, y, z)Expand and contract PhySprite3D. The expansion rate displayed on the expansion rate in World will be changed at the same time.
- Parameters:
- {Number} x
- x axis expansion rate.
- {Number} y
- y axis expansion rate.
- {Number} z
- z axis expansion rate.
-
translate(x, y, z)Move PhySprite3D horizontally. Displayed position and World position will be changed.
- Parameters:
- {Number} x
- Amount of parallel movement on x axis.
- {Number} y
- Amount of parallel movement on y axis.
- {Number} z
- Amount of parallel movement on z axis.