コード例 #1
0
        public CollisionResponse(CollistionDetails CollistionDetail)
        {
            this.CollisionForceVector = CollistionDetail.hitforcevector;
            this.CollisionPoint3D     = CollistionDetail.intersectionPoint;
            this.PlaneNormal          = CollistionDetail.PlaneNormal;

            FrictionForce = new Friction(
                CollistionDetail.DistanceFromCenterOfMass,
                CollisionForceVector
                );
        }
コード例 #2
0
        public bool IsIn(Point3D l0, Vector3D l, out CollistionDetails CollisionFound)
        {
            CollisionFound = new CollistionDetails();

            if (IsLineIntersection(l0, l, out CollisionFound.intersectionPoint))
            {
                if (IsPointIn(CollisionFound.intersectionPoint))
                {
                    Vector3D u = Vector3D.DotProduct(l, this.planeNormal) * this.planeNormal;
                    Vector3D w = l - u;
                    CollisionFound.hitforcevector = w - u;
                    CollisionFound.PlaneNormal    = planeNormal;

                    return(true);
                }
            }

            return(false);
        }
コード例 #3
0
 public bool IsIn(Point3D l0, Vector3D l, out CollistionDetails CollisionFound)
 {
     return(this.CollisionCheck.IsIn(l0, l, out CollisionFound));
 }