Physics

Summary
Physics
PhysicsStandardMaterialsEnumEternus.PhysicsWorld.Materials
Variables
INVALIDAn invalid material ID
DEFAULTFriction
TRIGGER_BROADRaise trigger events when fired by Broadphase detection.
TRIGGER_NARROWRaise trigger events when fired by Narrow detection.
TRIGGER_SOLVERRaise trigger events when fired by Solver.
TRIGGERThis defaults to TRIGGER_NARROW
DEBRISMarks collisions to have lower than average mass and temporarily disables collisions of any new interpenetrated contacts (prevents ‘explosions’ when spawning a lot of debris in roughly the same spot)
WELDINGMarks collisions to weld all triangles of a surface.
RUBBERA bouncy surface.
GLUEA very sticky surface.
STONEA rough surface that reflects 10% of collision force.
MUDA sticky surface that allows sinking.
ICEA very slippery surface.
WOODSlightly higher than average friction.
DIRTA rough surface.
SANDA surface with high stopping power and slight sinking allowance.
NUM_STANDARD_MATERIALSThe number of standard materials available.
PhysicsCollisionLayersEnumEternus.PhysicsWorld.Layers
Variables
DEFAULTSpecial layer that is the default for all objects with physics.
TERRAINSpecial layer that is assigned to all generated cell colliders
IGNORE_RAYCASTColliders on this layer will not interact with any raycasts / shapecasts
COLLIDER_PAWNSpecial layer that holds the Collider Pawn of a connected Client (Server view)
PLAYERSpecial layer that holds the human player
CHARACTERSpecial layer that holds anything that uses a controller (AI, Other Players)
RESERVED_6
RESERVED_7
RESERVED_8
USER_9
USER_10
USER_11
USER_12
USER_13
USER_14
USER_15
USER_16
USER_17
USER_18
USER_19
USER_20
USER_21
USER_22
USER_23
USER_24
USER_25
USER_26
USER_27
USER_28
USER_29
USER_30
USER_31
MAXThe max number of layers available
BEGIN_RESERVEDThe first ID of the reserved layers
END_RESERVEDThe last ID of the reserved layers
BEGIN_USERThe first ID of the user layers
END_USERThe last ID of the user layers
PlayerGPSInfoStructure that holds basic information about the primary player in the world
Functions
NKIsAboveTerrainA check to see if the primary player is above terrain.
NKIsUnderTerrainA check to see if the primary player is under terrain.
NKIsInsideTerrainA check to see if the primary player is inside terrain.
NKGetMaterialUnderPlayerReturns the material ID under the player
PhysicsWorldPhysics simulation API.
Functions
NKGetPlayerGPSGets a PlayerGPS struct that is filled with current frame info of the player’s position
NKSetMaxQueryResultsSet the maximum amount of query results that will be returned by a query
NKGetMaxQueryResultsReturns the current maximum query results that will be pushed to lua.
NKResetMaxQueryResultsResets the maximum number of queries to push to lua to the given value in user_config.txt (absolute default is 25)
NKSetLayerCollisionsEnableAllows setting collision behavior between two given layers.
NKQueryTraceWorld
NKQuerySweepWorld
NKQueryWorldOverlap
NKQueryObjectOverlap

PhysicsStandardMaterialsEnum

Eternus.PhysicsWorld.Materials

Enumerations that represent standard physics materials.

Comment

(In Development) Physics materials are still very experimental.  Expect this to change in the future.

Refer to the DEFAULT material as a guide for all physics materials.  All other materials will specify an overide value; non-specified values will be what is defined in DEFAULT material.

Summary
Variables
INVALIDAn invalid material ID
DEFAULTFriction
TRIGGER_BROADRaise trigger events when fired by Broadphase detection.
TRIGGER_NARROWRaise trigger events when fired by Narrow detection.
TRIGGER_SOLVERRaise trigger events when fired by Solver.
TRIGGERThis defaults to TRIGGER_NARROW
DEBRISMarks collisions to have lower than average mass and temporarily disables collisions of any new interpenetrated contacts (prevents ‘explosions’ when spawning a lot of debris in roughly the same spot)
WELDINGMarks collisions to weld all triangles of a surface.
RUBBERA bouncy surface.
GLUEA very sticky surface.
STONEA rough surface that reflects 10% of collision force.
MUDA sticky surface that allows sinking.
ICEA very slippery surface.
WOODSlightly higher than average friction.
DIRTA rough surface.
SANDA surface with high stopping power and slight sinking allowance.
NUM_STANDARD_MATERIALSThe number of standard materials available.

Variables

INVALID

An invalid material ID

DEFAULT

Friction

  • Dynamic = 0.5
  • Static = 0.5
  • Restitution = 0

Soft Contacts

  • Force Factor = 0
  • Dampening Factor = 0
  • Seperation Velocity = 0

TRIGGER_BROAD

Raise trigger events when fired by Broadphase detection.

Comment

When simulation detects broadphase AABB overlap a trigger event will be raised.

This provides the best performance at the cost of accuracy.

TRIGGER_NARROW

Raise trigger events when fired by Narrow detection.

Comment

When simulation generates a manifold during Narrow collision detection a trigger event will be raised.

This is a good balance between performance and accuracy.

TRIGGER_SOLVER

Raise trigger events when fired by Solver.

Comment

When a manifold would normally apply corrective impulse a trigger event will be raised.

This provides accuracy at the cost of performance.

TRIGGER

Comment

This defaults to TRIGGER_NARROW

DEBRIS

Marks collisions to have lower than average mass and temporarily disables collisions of any new interpenetrated contacts (prevents ‘explosions’ when spawning a lot of debris in roughly the same spot)

Comment

Currently acts like DEFAULT.  Can provide performance gain later.

WELDING

Marks collisions to weld all triangles of a surface.

Comment

(Redundant) Currently all materials are flagged to be welded.

RUBBER

A bouncy surface.

Comment

70% of the collision force is redirected along the contant normal...  Boing!

Friction

  • Restitution = 0.7

GLUE

A very sticky surface.

Comment

Friction

  • Dynamic = 2.0
  • Static = 2.0

STONE

A rough surface that reflects 10% of collision force.

Comment

Friction

  • Dynamic = 0.8
  • Static = 0.8
  • Restitution = 0.1

MUD

A sticky surface that allows sinking.

Comment

Friction

  • Dynamic = 0.1

Soft Contacts

  • Force Factor = 0.01
  • Dampening Factor = 0.03

ICE

A very slippery surface.

Comment

Friction

  • Dynamic = 0.0
  • Static = 0.0

WOOD

Slightly higher than average friction.

Comment

Friction

  • Dynamic = 0.8
  • Static = 0.8

DIRT

A rough surface.

Comment

EXPERIMENTAL

Friction

  • Dynamic = 0.75
  • Static = 0.6

SAND

A surface with high stopping power and slight sinking allowance.

Comment

EXPERIMENTAL

Friction

  • Dynamic = 1.1
  • Static = 1.5

Soft Contacts

  • Force Factor = 0.85
  • Dampening Factor = 1.0

NUM_STANDARD_MATERIALS

OOLUA_ENUM(
   NUM_STANDARD_MATERIALS
) ) OOLUA_PROXY_END typedef Havok::CollisionLayers PhysicsCollisionLayersEnum

The number of standard materials available.

PhysicsCollisionLayersEnum

Eternus.PhysicsWorld.Layers

Enumerations that represent different layer IDs.

Comment

Reserved layers are referenced internally by the engineyou can change the collision behavior of these layers.  User layers are free to be used for anything.  See NKPhysics.lua for safely using User owned collision layers.
Summary
Variables
DEFAULTSpecial layer that is the default for all objects with physics.
TERRAINSpecial layer that is assigned to all generated cell colliders
IGNORE_RAYCASTColliders on this layer will not interact with any raycasts / shapecasts
COLLIDER_PAWNSpecial layer that holds the Collider Pawn of a connected Client (Server view)
PLAYERSpecial layer that holds the human player
CHARACTERSpecial layer that holds anything that uses a controller (AI, Other Players)
RESERVED_6
RESERVED_7
RESERVED_8
USER_9
USER_10
USER_11
USER_12
USER_13
USER_14
USER_15
USER_16
USER_17
USER_18
USER_19
USER_20
USER_21
USER_22
USER_23
USER_24
USER_25
USER_26
USER_27
USER_28
USER_29
USER_30
USER_31
MAXThe max number of layers available
BEGIN_RESERVEDThe first ID of the reserved layers
END_RESERVEDThe last ID of the reserved layers
BEGIN_USERThe first ID of the user layers
END_USERThe last ID of the user layers

Variables

DEFAULT

Special layer that is the default for all objects with physics.  Collides with everything.

TERRAIN

Special layer that is assigned to all generated cell colliders

IGNORE_RAYCAST

Colliders on this layer will not interact with any raycasts / shapecasts

COLLIDER_PAWN

Special layer that holds the Collider Pawn of a connected Client (Server view)

PLAYER

Special layer that holds the human player

CHARACTER

Special layer that holds anything that uses a controller (AI, Other Players)

RESERVED_6

RESERVED_7

RESERVED_8

USER_9

USER_10

USER_11

USER_12

USER_13

USER_14

USER_15

USER_16

USER_17

USER_18

USER_19

USER_20

USER_21

USER_22

USER_23

USER_24

USER_25

USER_26

USER_27

USER_28

USER_29

USER_30

USER_31

MAX

The max number of layers available

BEGIN_RESERVED

The first ID of the reserved layers

END_RESERVED

The last ID of the reserved layers

BEGIN_USER

The first ID of the user layers

END_USER

The last ID of the user layers

PlayerGPSInfo

Structure that holds basic information about the primary player in the world

Summary
Functions
NKIsAboveTerrainA check to see if the primary player is above terrain.
NKIsUnderTerrainA check to see if the primary player is under terrain.
NKIsInsideTerrainA check to see if the primary player is inside terrain.
NKGetMaterialUnderPlayerReturns the material ID under the player

Functions

NKIsAboveTerrain

A check to see if the primary player is above terrain.

Returns

booltrue if player is above terrain geometry

NKIsUnderTerrain

A check to see if the primary player is under terrain.

Returns

booltrue if player is under terrain geometry

NKIsInsideTerrain

A check to see if the primary player is inside terrain.

Returns

booltrue if player is both above and under terrain geometry

NKGetMaterialUnderPlayer

Returns the material ID under the player

Returns

intmaterial ID

PhysicsWorld

Physics simulation API.

Summary
Functions
NKGetPlayerGPSGets a PlayerGPS struct that is filled with current frame info of the player’s position
NKSetMaxQueryResultsSet the maximum amount of query results that will be returned by a query
NKGetMaxQueryResultsReturns the current maximum query results that will be pushed to lua.
NKResetMaxQueryResultsResets the maximum number of queries to push to lua to the given value in user_config.txt (absolute default is 25)
NKSetLayerCollisionsEnableAllows setting collision behavior between two given layers.
NKQueryTraceWorld
NKQuerySweepWorld
NKQueryWorldOverlap
NKQueryObjectOverlap

Functions

NKGetPlayerGPS

Gets a PlayerGPS struct that is filled with current frame info of the player’s position

Returns

PlayerGPSInfoStruct filled with info

NKSetMaxQueryResults

Set the maximum amount of query results that will be returned by a query

Paramaters

intnumber of queries

NKGetMaxQueryResults

Returns the current maximum query results that will be pushed to lua.

Returns

intnumber of queries

NKResetMaxQueryResults

Resets the maximum number of queries to push to lua to the given value in user_config.txt (absolute default is 25)

NKSetLayerCollisionsEnable

Allows setting collision behavior between two given layers.

Paramaters

enabledBoolean
layerACollisionLayerID
layerBCollisionLayerID

NKQueryTraceWorld

int staticNKQueryTraceWorld(lua_State *vm)

Parameters

Tablethe QueryInput table

Comment

See CorePhysics.lua

NKQuerySweepWorld

int staticNKQuerySweepWorld(lua_State *vm)

Parameters

Tablethe QueryInput table

Comment

See CorePhysics.lua

NKQueryWorldOverlap

int staticNKQueryWorldOverlap(lua_State *vm)

Parameters

Tablethe QueryInput table

Comment

See CorePhysics.lua

NKQueryObjectOverlap

int staticNKQueryObjectOverlap(lua_State *vm)

Parameters

Tablethe QueryInput table

Comment

See CorePhysics.lua

Raise trigger events when fired by Narrow detection.
OOLUA_ENUM(
   NUM_STANDARD_MATERIALS
) ) OOLUA_PROXY_END typedef Havok::CollisionLayers PhysicsCollisionLayersEnum
The number of standard materials available.
int staticNKQueryTraceWorld(lua_State *vm)
int staticNKQuerySweepWorld(lua_State *vm)
int staticNKQueryWorldOverlap(lua_State *vm)
int staticNKQueryObjectOverlap(lua_State *vm)
Friction
Close