public override BoundingSphere GetBounds(SETItem item) { MatrixStack transform = new MatrixStack(); transform.Push(); transform.NJTranslate(item.Position); transform.Push(); transform.NJScale(4.5f, 4.5f, 4.5f); BoundingSphere bounds_sphere = ObjectHelper.GetModelBounds(sphere, transform); transform.Pop(); switch (type) { case WhaleDefType.AOSummon: transform.NJTranslate(item.Scale); transform.NJRotateY(item.Rotation.Y); break; case WhaleDefType.AOKill: transform.NJRotateZ(0x8000); break; case WhaleDefType.POSummon: transform.NJTranslate(item.Scale); transform.NJRotateX(0x2000); transform.NJRotateY(item.Rotation.Y); break; } transform.NJScale(0.4f, 0.4f, 0.4f); BoundingSphere bounds_whale = ObjectHelper.GetModelBounds(whale, transform); transform.Pop(); return(SAModel.Direct3D.Extensions.Merge(bounds_whale, bounds_sphere)); }
public override BoundingSphere GetBounds(SETItem item) { BoundingSphere boxSphere = new BoundingSphere() { Center = new Vertex((item.Position.X + 0.75f), (item.Position.Y + 55f), item.Position.Z), Radius = 100f }; return(boxSphere); }
public override BoundingSphere GetBounds(SETItem item) { 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; } float largestScale = scaleX; if (scaleY > largestScale) { largestScale = scaleY; } if (scaleZ > largestScale) { largestScale = scaleZ; } BoundingSphere boxSphere = new BoundingSphere() { Center = new Vertex(item.Position.X, item.Position.Y, item.Position.Z), Radius = largestScale }; return(boxSphere); }
public override BoundingSphere GetBounds(SETItem item) { MatrixStack transform = new MatrixStack(); float middle = (item.Position.Y + (item.Scale.Y / 2)); float radius = (((Math.Abs(item.Scale.Y)) / 2) + 50.0f); BoundingSphere boxSphere = new BoundingSphere() { Center = new Vertex((item.Position.X), (middle), item.Position.Z), Radius = radius }; return(boxSphere); }
public override BoundingSphere GetBounds(SETItem item) { MatrixStack transform = new MatrixStack(); BoundingSphere result = new BoundingSphere(); for (int i = 0; i < Math.Min(item.Scale.X + 1, 8); i++) { transform.Push(); if (item.Scale.Z == 1) // circle { double v4 = i * 360.0; Vector3 v7 = new Vector3( ObjectHelper.NJSin((int)(v4 / item.Scale.X * 65536.0 * 0.002777777777777778)) * item.Scale.Y, 0, ObjectHelper.NJCos((int)(v4 / item.Scale.X * 65536.0 * 0.002777777777777778)) * item.Scale.Y); transform.Push(); transform.NJTranslate(item.Position); transform.NJRotateObject(item.Rotation); Vector3 pos = Vector3.TransformCoordinate(v7, transform.Top); transform.Pop(); transform.NJTranslate(pos); } else // line { transform.Push(); transform.NJTranslate(item.Position); transform.NJRotateObject(item.Rotation); double v5; if (i % 2 == 1) { v5 = i * item.Scale.Y * -0.5; } else { v5 = Math.Ceiling(i * 0.5) * item.Scale.Y; } Vector3 pos = Vector3.TransformCoordinate(new Vector3(0, 0, (float)v5), transform.Top); transform.Pop(); transform.NJTranslate(pos); } result = SAModel.Direct3D.Extensions.Merge(result, ObjectHelper.GetModelBounds(model, transform)); transform.Pop(); } return(result); }
public override BoundingSphere GetBounds(SETItem item) { MatrixStack transform = new MatrixStack(); float middle = (item.Position.Y + (item.Scale.X / 2)); float radius = (((Math.Abs(item.Scale.X)) / 2) + 50.0f); BoundingSphere boxSphere = new BoundingSphere() { Center = new Vertex((item.Position.X), (middle), item.Position.Z), Radius = radius }; return(boxSphere); //transform.NJTranslate(item.Position); //transform.NJRotateY(item.Rotation.Y); //return ObjectHelper.GetModelBounds(Wele1, transform); }
public override BoundingSphere GetBounds(SETItem item) { float largestScale = item.Scale.X; if (item.Scale.Y > largestScale) { largestScale = item.Scale.Y; } if (item.Scale.Z > largestScale) { largestScale = item.Scale.Z; } BoundingSphere boxSphere = new BoundingSphere() { Center = new Vertex(item.Position.X, item.Position.Y, item.Position.Z), Radius = (1.5f * largestScale) }; return(boxSphere); }
public override List <RenderInfo> Render(SETItem item, Device dev, EditorCamera camera, MatrixStack transform) { List <RenderInfo> result = new List <RenderInfo>(); transform.Push(); transform.NJTranslate(item.Position); transform.NJRotateY(item.Rotation.Y - 0x5772); transform.NJScale(item.Scale.X, item.Scale.Y, item.Scale.Z); float largestScale = item.Scale.X; if (item.Scale.Y > largestScale) { largestScale = item.Scale.Y; } if (item.Scale.Z > largestScale) { largestScale = item.Scale.Z; } BoundingSphere boxSphere = new BoundingSphere() { Center = new Vertex(item.Position.X, item.Position.Y, item.Position.Z), Radius = (1.5f * largestScale) }; RenderInfo outputInfo = new RenderInfo(mesh, 0, transform.Top, material, null, FillMode.Solid, boxSphere); result.Add(outputInfo); if (item.Selected) { RenderInfo highlightInfo = new RenderInfo(mesh, 0, transform.Top, material, null, FillMode.Wireframe, boxSphere); result.Add(highlightInfo); } transform.Pop(); return(result); }
public override BoundingSphere GetBounds(SETItem item) { MatrixStack transform = new MatrixStack(); BoundingSphere result = new BoundingSphere(); int rows = (int)Math.Max(item.Scale.X, 1); int cols = (int)Math.Max(item.Scale.Z, 1); transform.NJTranslate(item.Position); transform.NJRotateObject(item.Rotation.X & 0xC000, item.Rotation.Y, 0); transform.NJTranslate((1 - rows) * 7.5f, 0, (1 - cols) * 7.5f); for (int i = 0; i < rows; ++i) { transform.Push(); for (int j = 0; j < cols; ++j) { result = SAModel.Direct3D.Extensions.Merge(result, ObjectHelper.GetModelBounds(model, transform)); transform.NJTranslate(0, 0, 15); } transform.Pop(); transform.NJTranslate(15, 0, 0); } return(result); }
public override List <RenderInfo> Render(SETItem item, Device dev, EditorCamera camera, MatrixStack transform) { List <RenderInfo> result = new List <RenderInfo>(); 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); float largestScale = item.Scale.X; if (item.Scale.Z > largestScale) { largestScale = item.Scale.Z; } BoundingSphere boxSphere = new BoundingSphere() { Center = new Vertex(item.Position.X, item.Position.Y, item.Position.Z), Radius = largestScale }; RenderInfo outputInfo = new RenderInfo(mesh, 0, transform.Top, material, null, FillMode.Wireframe, boxSphere); result.Add(outputInfo); if (item.Selected) { RenderInfo highlightInfo = new RenderInfo(mesh, 0, transform.Top, material, null, FillMode.Wireframe, boxSphere); result.Add(highlightInfo); } transform.Pop(); return(result); }
public override BoundingSphere GetBounds(SETItem item) { BoundingSphere bounds = new BoundingSphere(item.Position, item.Scale.X); return(bounds); }