Physics Help

Introduction

The IMML Physics element controls whether the element can be affected by physics in-world. An element that could logically be affected by physics (e.g a primitive, model or widget) can have physical effects applied to them, such as Impulse and Explosions.

Child Element

The Physics element can have these elements nested within

  • Interaction

Attributes

Enabled

Type imml:Boolean
Use optional
Documentation When true, requires the parent element to be included in the physics engine operations

Weight

Type xs:float
Use optional
Documentation Weight of the element in kilograms

Movable

Type imml:Boolean
Use optional
Default True
Documentation When true, the physics engine should allow the body that represents this element to move

Bounding

Type imml:BoundingType
Use optional
Default ConvexHull
Documentation The style of physics bounding to use. Performance and interaction requirements should be taken into account when selecting a bounding type. By default, the BoundingType will wrap as closely as possible to the element's bounds.

Centre

Type imml:Vector3
Use optional
Documentation The centre of mass the element should have.

Example

Here is an example of a Physics element in IMML

1 <Primitive Type="Box" Size="100,1,100" Name="Ground">
2    <Physics Enabled="True" Movable="False" />
3 </Primitive>

There is an example of an extensive implementation of a the physics element in Gravity example IMML.

Further reading