コード例 #1
0
ファイル: SplineData.cs プロジェクト: Shadowth117/sa_tools
        // override implementations go here!
        public override HitResult CheckHit(Vector3 Near, Vector3 Far, Viewport Viewport, Matrix Projection, Matrix View)
        {
            MatrixStack transform = new MatrixStack();

            #region Checking Vertex Handles
            if (Selected)
            {
                foreach (PathDataEntry splineVertex in splineData.Path)
                {
                    transform.Push();

                    transform.NJTranslate(splineVertex.Position.X, splineVertex.Position.Y, splineVertex.Position.Z);

                    HitResult hitResult = vertexHandleMesh.CheckHit(Near, Far, Viewport, Projection, View, transform);

                    transform.Pop();

                    if (hitResult.IsHit)
                    {
                        selectedKnot = splineData.Path.FindIndex(item => item == splineVertex);
                        vertexHelper.SetPoint(splineData.Path[selectedKnot].Position);
                        return(hitResult);
                    }
                }
            }
            #endregion

            transform.Push();
            return(mesh.CheckHit(Near, Far, Viewport, Projection, View, transform));
        }
コード例 #2
0
ファイル: PUWind.cs プロジェクト: Shadowth117/sa_tools
        public override HitResult CheckHit(SETItem item, Vector3 Near, Vector3 Far, Viewport Viewport, Matrix Projection, Matrix View, MatrixStack transform)
        {
            transform.Push();
            transform.NJTranslate(item.Position);
            transform.NJRotateY(item.Rotation.Y - 0x5772);
            transform.NJScale(item.Scale.X, item.Scale.Y, item.Scale.Z);
            HitResult result = mesh.CheckHit(Near, Far, Viewport, Projection, View, transform);

            transform.Pop();
            return(result);
        }
コード例 #3
0
        public override HitResult CheckHit(SETItem item, Vector3 Near, Vector3 Far, Viewport Viewport, Matrix Projection, Matrix View, MatrixStack transform)
        {
            transform.Push();
            float scaleX = item.Scale.X;
            float scaleY = item.Scale.Y * 0.5f;
            float scaleZ = item.Scale.Z;

            if (scaleX >= 10.0f)
            {
                if (scaleX > 200.0f)
                {
                    scaleX = 200f;
                }
            }
            else
            {
                scaleX = 10f;
            }
            if (scaleY >= 10.0f)
            {
                if (scaleY > 200.0f)
                {
                    scaleY = 200f;
                }
            }
            else
            {
                scaleY = 10f;
            }
            if (scaleZ >= 10.0f)
            {
                if (scaleZ > 200.0f)
                {
                    scaleZ = 200f;
                }
            }
            else
            {
                scaleZ = 10f;
            }
            transform.NJTranslate(item.Position);
            transform.NJRotateY(item.Rotation.Y);
            transform.NJScale(scaleX, scaleY, scaleZ);
            HitResult result = mesh.CheckHit(Near, Far, Viewport, Projection, View, transform);

            transform.Pop();
            return(result);
        }
コード例 #4
0
ファイル: ObjectHelper.cs プロジェクト: Shadowth117/sa_tools
 public static HitResult CheckQuestionBoxHit(Vector3 Near, Vector3 Far, Viewport Viewport, Matrix Projection, Matrix View, MatrixStack transform)
 {
     return(QuestionBoxMesh.CheckHit(Near, Far, Viewport, Projection, View, transform));
 }