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
newPos
protected Vec3d newPos
Field Value
Properties
FlagTickDone
Flag for load balancer.
public ref int FlagTickDone { get; }
Property Value
Ticking
public bool Ticking { get; set; }
Property Value
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
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
EntityPropertiesThe properties of this entity.
attributes
JsonObjectThe attributes of this entity.
MotionAndCollision(EntityPos, float)
public void MotionAndCollision(EntityPos pos, float dt)
Parameters
OnEntityDespawn(EntityDespawnData)
The event fired when the entity is despawned.
public override void OnEntityDespawn(EntityDespawnData despawn)
Parameters
despawn
EntityDespawnDataThe 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
boolWhether or not this entity was teleported.
handled
EnumHandlingHow this event is handled.
PropertyName()
The name of the property tied to this entity behavior.
public override string PropertyName()
Returns
RemoteMotionAndCollision(EntityPos, float)
public void RemoteMotionAndCollision(EntityPos pos, float dtFactor)
Parameters
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)