// 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)); }
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); }
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); }
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)); }