Method CastCapsule
- Namespace
- Box3D
- Assembly
- Box3D.NET.dll
CastCapsule(Capsule, Vector3, Vector3, QueryFilter?)
Sweeps a character capsule through the world and reports how far it got.
public float CastCapsule(Capsule capsule, Vector3 origin, Vector3 translation, QueryFilter? filter = null)Parameters
capsuleCapsule-
The capsule, relative to
origin. originVector3-
The world position the capsule is measured from.
translationVector3-
The movement to attempt.
filterQueryFilter?-
Which shapes block the capsule, or null for everything.
Returns
- float
-
The fraction of
translationthe capsule could travel, from zero for blocked immediately to one for unobstructed.
Remarks
A specialised shape cast that slides along surfaces instead of catching on them. Useful for a quick "can the character get there" test, but a poor source of information about what it is touching; use Box3D.PhysicsWorld.CollideCapsule``1(Box3D.Capsule,System.Numerics.Vector3,``0@,System.Nullable{Box3D.QueryFilter}) for that.
Exceptions
- ObjectDisposedException
-
The world has been disposed.