Table of Contents

Class EntityBehaviorPassivePhysics

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll
public class EntityBehaviorPassivePhysics : EntityBehavior, IRenderer, IDisposable
Inheritance
EntityBehaviorPassivePhysics
Implements
Inherited Members

Constructors

EntityBehaviorPassivePhysics(Entity)

public EntityBehaviorPassivePhysics(Entity entity)

Parameters

entity Entity

Fields

OnPhysicsTickCallback

If set, will test for entity collision every tick (expensive)

public Action<float> OnPhysicsTickCallback

Field Value

Action<float>

UsePhysicsDormancyStateClient

True when theres 1000 currently loaded entities. This will cause dropped items to enter a physics dormancy state if the conditions are right. Set by ModSystemDormancyStateChecker in EntityItemRenderer.cs

public static bool UsePhysicsDormancyStateClient

Field Value

bool

UsePhysicsDormancyStateServer

True when theres 1000 currently loaded entities. This will cause dropped items to enter a physics dormancy state if the conditions are right. Set by ModSystemDormancyStateChecker in EntityItemRenderer.cs

public static bool UsePhysicsDormancyStateServer

Field Value

bool

clientPhysicsTickTimeThreshold

public float clientPhysicsTickTimeThreshold

Field Value

float

collisionYExtra

public float collisionYExtra

Field Value

float

duringRenderFrame

protected bool duringRenderFrame

Field Value

bool

Properties

RenderOrder

0 = drawn first, 1 = drawn last
Default render orders by render stage:
Before:
0 = Ambient Manager
0 = Camera

Opaque:
0.1 = Blue sky (Icosahedron)
0.2 = Night skybox
0.3 = Sun and moon
0.37 = Terrain opaque
0.4 = Enitities
0.5 = Decals
0.5 = Debug wireframe
0.6 = particles
0.7 = Cinematic camera line preview
0.8 = fp held item
0.9 = held item opaque custom renderer

OIT:
0.2 = Frame buffer debug screen
0.35 = Clouds
0.37 = Terrain oit
0.4 = Enitities
0.6 = particles
0.9 = held item oit custom renderer

Shadow far:
0 = shadow map init
0.37 = Terrain shadow far
0.4 = Enitities

Shadow far done:
1 = shadow map finish

Shadow near:
0 = shadow map init
0.37 = Terrain shadow near
0.4 = Enitities

Shadow near done:
1 = shadow map finish
Ortho:
0.2 = Frame buffer debug screen
0.4 = Enitities
0.9 = held item ortho custom renderer
0.95 = sleeping overlay
0.98 = bow/spear aiming reticle
1 = Gui manager
1.02 = crosshair and mouse cursor

AfterFinalComposition:
2 = screenshot

Done:
0.1 = gui manager
2 = screenshot

0.98 = Cinematic camera camera advancing and frame capture when recording
0.99 = Chunk Tesselator Manager (uploads new/modified chunk meshes)
0.999 = Compress chunks scan
1 = video recorder

public double RenderOrder { get; }

Property Value

double

RenderRange

Within what range to the player OnRenderFrame() should be called (currently not used!)

public int RenderRange { get; }

Property Value

int

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

DoPhysics(float, EntityPos)

Performs the physics on the specified entity.

public void DoPhysics(float dt, EntityPos pos)

Parameters

dt float
pos EntityPos

Initialize(EntityProperties, JsonObject)

Initializes the entity.
If your code modifies the supplied attributes (not recommended!), then your changes will apply to all entities of the same type.

public override void Initialize(EntityProperties properties, JsonObject attributes)

Parameters

properties EntityProperties

The properties of this entity.

attributes JsonObject

The attributes of this entity.

OnEntityDespawn(EntityDespawnData)

The event fired when the entity is despawned.

public override void OnEntityDespawn(EntityDespawnData despawn)

Parameters

despawn EntityDespawnData

The reason the entity despawned.

OnGameTick(float)

The event fired when a game ticks over.

public override void OnGameTick(float deltaTime)

Parameters

deltaTime float

OnRenderFrame(float, EnumRenderStage)

Called every frame for rendering whatever you need to render

public void OnRenderFrame(float deltaTime, EnumRenderStage stage)

Parameters

deltaTime float
stage EnumRenderStage

PropertyName()

The name of the property tied to this entity behavior.

public override string PropertyName()

Returns

string

onPhysicsTick(float, bool)

public void onPhysicsTick(float deltaTime, bool usePhysicsDormancyState)

Parameters

deltaTime float
usePhysicsDormancyState bool