Hi Norbo,
is it somehow possible to check whether a point is inside a phyiscs entity?
Here is my current working code. Is there any overhead expect of the out params? Is this solution recommended?
Vector3 hitLocation;
Vector3 hitNormal;
float t;
bool isCameraInsideCone = Toolbox.RayCast(Camera.Position, Vector3.Zero, 1f, PhysicsEntity, PhysicsEntity.CollisionMargin, out hitLocation, out hitNormal, out t)
Thanks,
steko
Point intersection test
Re: Point intersection test
MPRToolbox.IsPointInsideEntity is an option. Using a raycast would be generally fine too. The overhead of unused out params is practically nonexistent compared to the cost of the rest of the function.
Re: Point intersection test
thanks, I didn't noticed the MPRToolbox class. What exactly are the differences between Toolbox and MPRToolbox? Is this MPRToolbox limited to any simulation settings?
Re: Point intersection test
The MPRToolbox is just an intermediate move towards segmenting the giant Toolbox into more organized components. In v0.15.0, the Toolbox gets split a bit more (GJK stuff has its own Toolbox too). Eventually, I'd like to have a clean, implementation-abstracted Toolbox for common tasks, rather than the current giant list of questionable miscellaneous functions.
Since it's just an organization thing, there are no extra limitations with its usage.
Since it's just an organization thing, there are no extra limitations with its usage.