I've problem with SegmentIntersection
ana4dev 19 Nov 2011 10:31
hi all.
I'm workin 3d game project in xna3.1 with jigLibX…
The JigLibX is very nice.
But I've problem with segmentIntersection.
I am made class Enemy based on characterObject. and contains this method:
public bool SeePlayer(Vector3 PlayerPosition, CollisionSkin PlayerSkin,ref PhysicsSystem physicsSystem)
{
Vector3 rayTo = this.Position;
float frac; CollisionSkin skin; Vector3 pos, normal;
ImmovableSkinPredicate pred = new ImmovableSkinPredicate();
physicsSystem.CollisionSystem.SegmentIntersect(out frac, out skin, out pos, out normal,
new Segment(rayTo, PlayerPosition), pred);
if (skin!=null && skin == PlayerSkin)
return true;
else
return false;
}
the problem is: the skin variable is all of the time equal to null…
what i do to solve this problem…