Class CachingCollisionTester
- Namespace
- Vintagestory.API.MathTools
- Assembly
- VintagestoryAPI.dll
Originally intended to be a special version of CollisionTester for BehaviorControlledPhysics, which does not re-do the WalkBlocks() call and re-generate the CollisionBoxList more than once in the same entity tick
Currently in 1.20 the caching is not very useful when we loop through all entities sequentially - but empirical testing shows it is actually faster not to cache
public class CachingCollisionTester : CollisionTester
- Inheritance
-
CachingCollisionTester
- Inherited Members
- Extension Methods
Methods
AssignToEntity(PhysicsBehaviorBase, int)
public void AssignToEntity(PhysicsBehaviorBase entityPhysics, int dimension)
Parameters
entityPhysics
PhysicsBehaviorBasedimension
int
GenerateCollisionBoxList(IBlockAccessor, double, double, double, float, float, int)
protected override void GenerateCollisionBoxList(IBlockAccessor blockAccessor, double motionX, double motionY, double motionZ, float stepHeight, float yExtra, int dimension)
Parameters
blockAccessor
IBlockAccessormotionX
doublemotionY
doublemotionZ
doublestepHeight
floatyExtra
floatdimension
int
NewTick(EntityPos)
public void NewTick(EntityPos entityPos)
Parameters
entityPos
EntityPos
PushOutFromBlocks(IBlockAccessor, Entity, Vec3d, float)
public void PushOutFromBlocks(IBlockAccessor blockAccessor, Entity entity, Vec3d tmpVec, float clippingLimit)
Parameters
blockAccessor
IBlockAccessorentity
EntitytmpVec
Vec3dclippingLimit
float