Table of Contents

Class EntityBehaviorPassivePhysics

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll
public class EntityBehaviorPassivePhysics : PhysicsBehaviorBase, IPhysicsTickable, IRemotePhysics
Inheritance
EntityBehaviorPassivePhysics
Implements
Inherited Members
Extension Methods

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>

newPos

protected Vec3d newPos

Field Value

Vec3d

Properties

FlagTickDone

Flag for load balancer.

public ref int FlagTickDone { get; }

Property Value

int

Ticking

public bool Ticking { get; set; }

Property Value

bool

Methods

AfterPhysicsTick(float)

Called after physics has ticked and is thread-safe.

public void AfterPhysicsTick(float dt)

Parameters

dt float

ApplyTests(EntityPos)

public void ApplyTests(EntityPos pos)

Parameters

pos EntityPos

HandleRemotePhysics(float, bool)

public void HandleRemotePhysics(float dt, bool isTeleport)

Parameters

dt float
isTeleport bool

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.

MotionAndCollision(EntityPos, float)

public void MotionAndCollision(EntityPos pos, float dt)

Parameters

pos EntityPos
dt float

OnEntityDespawn(EntityDespawnData)

The event fired when the entity is despawned.

public override void OnEntityDespawn(EntityDespawnData despawn)

Parameters

despawn EntityDespawnData

The reason the entity despawned.

OnPhysicsTick(float)

Called at a fixed interval 10 times per second.

public void OnPhysicsTick(float dt)

Parameters

dt float

OnReceivedClientPos(int)

public void OnReceivedClientPos(int version)

Parameters

version int

OnReceivedServerPos(bool, ref EnumHandling)

The event fired when the server position is changed.

public override void OnReceivedServerPos(bool isTeleport, ref EnumHandling handled)

Parameters

isTeleport bool

Whether or not this entity was teleported.

handled EnumHandling

How this event is handled.

PropertyName()

The name of the property tied to this entity behavior.

public override string PropertyName()

Returns

string

RemoteMotionAndCollision(EntityPos, float)

public void RemoteMotionAndCollision(EntityPos pos, float dtFactor)

Parameters

pos EntityPos
dtFactor float

SetProperties(JsonObject)

public virtual void SetProperties(JsonObject attributes)

Parameters

attributes JsonObject

SetState(EntityPos)

public void SetState(EntityPos pos)

Parameters

pos EntityPos

applyCollision(EntityPos, float)

protected virtual void applyCollision(EntityPos pos, float dtFactor)

Parameters

pos EntityPos
dtFactor float