MPhysicsProperties

(Difference between revisions)
Jump to: navigation, search
Line 7: Line 7:
 
These properties can also be edited from the ''Maratis Editor''.
 
These properties can also be edited from the ''Maratis Editor''.
  
The properties are mere value holders for the [[MPhysicsContext|physics engine]] engine. This means that editing them when the game is already started will have no effect at all. The properties takes effect only when the scene prepares the physics ([[MScene#preparePhysics|MScene::preparePhysics]]) creating the collision objects for every entity.
+
The properties are mere value holders for the [[MPhysicsContext|physics engine]]. This means that editing them when the game is already started will have no effect at all. The properties takes effect only when the scene prepares the physics ([[MScene#preparePhysics|MScene::preparePhysics]]) creating the collision objects for every entity.
  
 
However you can apply the new values using these methods of [[MPhysicsContext]]:
 
However you can apply the new values using these methods of [[MPhysicsContext]]:
 
[[MPhysicsContext#setObjectShape|setObjectShape]]
 
  
 
[[MPhysicsContext#setObjectMass|setObjectMass]]
 
[[MPhysicsContext#setObjectMass|setObjectMass]]
Line 32: Line 30:
  
 
[http://code.google.com/p/maratis/source/browse/trunk/dev/MSDK/MEngine/Sources/MOEntity.cpp MOEntity.cpp]
 
[http://code.google.com/p/maratis/source/browse/trunk/dev/MSDK/MEngine/Sources/MOEntity.cpp MOEntity.cpp]
 +
 +
 +
==API==
 +
===constraint===
 +
====deleteConstraint====
 +
[...]
 +
====createConstraint====
 +
[...]
 +
====getConstraint====
 +
[...]
 +
 +
===Shape ID===
 +
====setShapeId====
 +
[...]
 +
====getShapeId====
 +
[...]
 +
 +
===Collision object ID===
 +
====setCollisionObjectId====
 +
[...]
 +
====getCollisionObjectId====
 +
[...]
 +
 +
===Collision shape===
 +
====setCollisionShape====
 +
[...]
 +
====getCollisionShape====
 +
[...]
 +
 +
===Ghost===
 +
====setGhost====
 +
[...]
 +
====isGhost====
 +
[...]
 +
 +
===Mass===
 +
====setMass====
 +
[...]
 +
====getMass====
 +
[...]
 +
 +
===Friction===
 +
====setFriction====
 +
[...]
 +
====getFriction====
 +
[...]
 +
 +
===Restitution===
 +
====setRestitution====
 +
[...]
 +
====getRestitution====
 +
[...]
 +
 +
===Linear damping===
 +
====setLinearDamping====
 +
[...]
 +
====getLinearDamping====
 +
[...]
 +
 +
===Angular damping===
 +
====setAngularDamping====
 +
[...]
 +
====getAngularDamping====
 +
[...]
 +
 +
===Angular factor===
 +
====setAngularFactor====
 +
[...]
 +
====getAngularFactor====
 +
[...]
 +
 +
===Linear factor===
 +
====setLinearFactor====
 +
[...]
 +
====getLinearFactor====
 +
[...]

Revision as of 21:58, 22 August 2013

MPhysicsProperties is a class used by MOEntity.

The class is defined in the MOEntity source code itself.

MPhysicsProperties contains all the properties that will be used from the physics engine.

These properties can also be edited from the Maratis Editor.

The properties are mere value holders for the physics engine. This means that editing them when the game is already started will have no effect at all. The properties takes effect only when the scene prepares the physics (MScene::preparePhysics) creating the collision objects for every entity.

However you can apply the new values using these methods of MPhysicsContext:

setObjectMass

setObjectRestitution

setObjectFriction

setObjectLinearFactor

setObjectAngularFactor

setObjectDamping

Another option is to reload all the physics properties of the entity using MScene::prepareCollisionShape and MScene::PrepareCollisionObject.


Contents

Source code

MOEntity.h

MOEntity.cpp


API

constraint

deleteConstraint

[...]

createConstraint

[...]

getConstraint

[...]

Shape ID

setShapeId

[...]

getShapeId

[...]

Collision object ID

setCollisionObjectId

[...]

getCollisionObjectId

[...]

Collision shape

setCollisionShape

[...]

getCollisionShape

[...]

Ghost

setGhost

[...]

isGhost

[...]

Mass

setMass

[...]

getMass

[...]

Friction

setFriction

[...]

getFriction

[...]

Restitution

setRestitution

[...]

getRestitution

[...]

Linear damping

setLinearDamping

[...]

getLinearDamping

[...]

Angular damping

setAngularDamping

[...]

getAngularDamping

[...]

Angular factor

setAngularFactor

[...]

getAngularFactor

[...]

Linear factor

setLinearFactor

[...]

getLinearFactor

[...]

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox