public override List <RenderInfo> Render(SETItem item, Device dev, EditorCamera camera, MatrixStack transform) { List <RenderInfo> result = new List <RenderInfo>(); ((BasicAttach)model.Children[childindex].Attach).Material[0].TextureID = itemTexs[Math.Min(Math.Max((int)item.Scale.X, 0), 8)]; transform.Push(); transform.NJTranslate(item.Position); result.AddRange(model.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("OBJ_REGULAR"), meshes)); if (item.Selected) { result.AddRange(model.DrawModelTreeInvert(transform, meshes)); } transform.Pop(); return(result); }
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.NJScale((item.Scale.X + 10f), (item.Scale.Y + 10f), (item.Scale.Z + 10f)); result.AddRange(model.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("OBJ_BEACH"), mesh, boundsByMesh: true)); if (item.Selected) { result.AddRange(model.DrawModelTreeInvert(transform, mesh, boundsByMesh: true)); } transform.Pop(); return(result); }
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.NJScale((item.Scale.X + 1f), (item.Scale.X + 1f), (item.Scale.X + 1f)); result.AddRange(sphere.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, null, spheremsh, boundsByMesh: true)); if (item.Selected) { result.AddRange(sphere.DrawModelTreeInvert(transform, spheremsh, boundsByMesh: true)); } transform.Pop(); return(result); }
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.NJRotateObject(item.Rotation.X, item.Rotation.Y - 0x8000, item.Rotation.Z); result.AddRange(model.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("e_g_kumitex"), meshes, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); if (item.Selected) { result.AddRange(model.DrawModelTreeInvert(transform, meshes)); } transform.Pop(); return(result); }
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.X, item.Position.Y + 8, item.Position.Z); transform.NJRotateY(item.Rotation.Y); result.AddRange(model.DrawModelTree(dev, transform, ObjectHelper.GetTextures("mi_3dasu"), meshes)); if (item.Selected) { result.AddRange(model.DrawModelTreeInvert(transform, meshes)); } transform.Pop(); return(result); }
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.NJRotateObject(item.Rotation); result.AddRange(model.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("OBJ_WINDY"), meshes)); if (item.Selected) { result.AddRange(model.DrawModelTreeInvert(transform, meshes)); } transform.Pop(); return(result); }
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); transform.NJScale((item.Scale.X + 10) / 5f, (item.Scale.Y + 10) / 5f, (item.Scale.Z + 10) / 5f); result.AddRange(model.DrawModelTree(dev, transform, null, meshes)); if (item.Selected) { result.AddRange(model.DrawModelTreeInvert(transform, meshes)); } transform.Pop(); return(result); }
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.NJRotateObject(item.Rotation); transform.NJTranslate(2f, 0f, 0f); result.AddRange(frog.DrawModelTree(dev, transform, ObjectHelper.GetTextures("BIG_KAERU"), frogmsh)); if (item.Selected) { result.AddRange(frog.DrawModelTreeInvert(transform, frogmsh)); } transform.Pop(); return(result); }
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); transform.NJScale((item.Scale.X + 1f), (item.Scale.Y + 1f), (item.Scale.Z + 1f)); result.AddRange(model.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("OBJ_BEACH"), mesh, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); if (item.Selected) { result.AddRange(model.DrawModelTreeInvert(transform, mesh)); } transform.Pop(); return(result); }
public override List <RenderInfo> Render(SETItem item, Device dev, EditorCamera camera, MatrixStack transform) { List <RenderInfo> result = new List <RenderInfo>(); if (item.Scale.Y != 0) { if ((item.Scale.Y - 1) == 0 && (item.Scale.Y - 1) == 1) { transform.Push(); transform.NJTranslate(item.Position.X, (item.Position.Y + 10f), item.Position.Z); transform.NJRotateObject(item.Rotation); result.AddRange(eme_b.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("KAOS_EME"), ememsh_b)); if (item.Selected) { result.AddRange(eme_b.DrawModelTreeInvert(transform, ememsh_b)); } transform.Pop(); return(result); } else { transform.Push(); transform.NJTranslate(item.Position.X, (item.Position.Y + 10f), item.Position.Z); transform.NJRotateObject(item.Rotation); result.AddRange(eme_c.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("KAOS_EME"), ememsh_c)); if (item.Selected) { result.AddRange(eme_c.DrawModelTreeInvert(transform, ememsh_c)); } transform.Pop(); return(result); } } else { transform.Push(); transform.NJTranslate(item.Position.X, (item.Position.Y + 10f), item.Position.Z); transform.NJRotateObject(item.Rotation); result.AddRange(eme_a.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("KAOS_EME"), ememsh_a)); if (item.Selected) { result.AddRange(eme_a.DrawModelTreeInvert(transform, ememsh_a)); } transform.Pop(); return(result); } }
public override List <RenderInfo> Render(SETItem item, Device dev, EditorCamera camera, MatrixStack transform) { List <RenderInfo> result = new List <RenderInfo>(); transform.Push(); ((BasicAttach)model.Children[1].Attach).Material[0].TextureID = ((MissionSETItem)item).PRMBytes[8] % 5 + 7; transform.NJTranslate(item.Position); transform.NJRotateY(item.Rotation.Y); transform.NJScale(item.Scale); result.AddRange(model.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("Mission"), meshes)); if (item.Selected) { result.AddRange(model.DrawModelTreeInvert(transform, meshes)); } transform.Pop(); return(result); }
public override void Render(Device dev, EditorCamera cam) { if (model == null) { return; } texs = ObjectHelper.GetTextures("MR_SKY0" + Act.ToString()); List <RenderInfo> result = new List <RenderInfo>(); MatrixStack transform = new MatrixStack(); transform.Push(); transform.NJTranslate(cam.Position.X, 0, cam.Position.Z); transform.NJScale(Skybox_Scale); result.AddRange(model.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, texs, meshes, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); transform.Pop(); RenderInfo.Draw(result, dev, cam); }
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); int RotY = item.Rotation.Y + 34; if ((RotY + 24) != 0x4000) { transform.NJRotateY((RotY + 24) - 0x4000); } transform.NJScale(1.5f, 1.5f, 1.5f); result.AddRange(model.DrawModelTree(dev.GetRenderState<FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("OBJ_BEACH"), meshes, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); if (item.Selected) result.AddRange(model.DrawModelTreeInvert(transform, meshes)); transform.Pop(); return result; }
public override void Render(Device dev, EditorCamera cam) { texs_bg_beach = ObjectHelper.GetTextures("BG_BEACH"); texs_obj_beach = ObjectHelper.GetTextures("OBJ_BEACH"); List <RenderInfo> result1 = new List <RenderInfo>(); List <RenderInfo> result2 = new List <RenderInfo>(); MatrixStack transform = new MatrixStack(); // Part 1 - skybox (no Z Write) transform.Push(); transform.NJTranslate(cam.Position.X, 0, cam.Position.Z); transform.NJScale(Skybox_Scale); result1.AddRange(model1.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, texs_bg_beach, mesh1, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); result1.AddRange(model2.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, texs_bg_beach, mesh2, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); transform.Pop(); RenderInfo.Draw(result1, dev, cam); // Bridge in Act 1 if (Act == 0) { dev.SetRenderState(RenderState.ZWriteEnable, true); transform.Push(); // Main part 1 transform.NJTranslate(2803.0f, -1.0f, 365.0f); result2.AddRange(modelbridge.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, texs_obj_beach, meshbridge, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); // Repeated parts transform.NJTranslate(75.0f, 9.5f, 0.0f); for (int i = 0; i < 25; i++) { // 1 transform.NJTranslate(20.0f, 0.0f, 0.0f); result2.AddRange(modelbridge2.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, texs_obj_beach, meshbridge2, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); // 2 transform.NJTranslate(20.0f, 0.0f, 0.0f); result2.AddRange(modelbridge3.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, texs_obj_beach, meshbridge3, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); } // Small chunk transform.NJTranslate(20.0f, 0.0f, 0.0f); result2.AddRange(modelbridge2.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, texs_obj_beach, meshbridge2, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); // Main part 2 transform.NJTranslate(95.0f, -9.5f, 0.0f); // Y is 0.0 in original code at 0x501AD6, no idea why result2.AddRange(modelbridge4.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, texs_obj_beach, meshbridge4, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); transform.Pop(); RenderInfo.Draw(result2, dev, cam); } }
public override List <RenderInfo> Render(SETItem item, Device dev, EditorCamera camera, MatrixStack transform) { if (item.Scale.Z == 0.0) { List <RenderInfo> result = new List <RenderInfo>(); transform.Push(); transform.NJTranslate(item.Position); transform.NJRotateObject(item.Rotation); result.AddRange(model1.DrawModelTree(dev, transform, ObjectHelper.GetTextures("OBJ_BEACH"), meshes1)); if (item.Selected) { result.AddRange(model1.DrawModelTreeInvert(transform, meshes1)); } transform.Pop(); return(result); } else if (item.Scale.Z <= 5.0) { List <RenderInfo> result = new List <RenderInfo>(); transform.Push(); transform.NJTranslate(item.Position); transform.NJRotateObject(item.Rotation); result.AddRange(model2.DrawModelTree(dev, transform, ObjectHelper.GetTextures("OBJ_BEACH"), meshes2)); if (item.Selected) { result.AddRange(model2.DrawModelTreeInvert(transform, meshes2)); } transform.Pop(); return(result); } else { List <RenderInfo> result = new List <RenderInfo>(); transform.Push(); transform.NJTranslate(item.Position); transform.NJRotateObject(item.Rotation); result.AddRange(model3.DrawModelTree(dev, transform, ObjectHelper.GetTextures("OBJ_BEACH"), meshes3)); if (item.Selected) { result.AddRange(model3.DrawModelTreeInvert(transform, meshes3)); } transform.Pop(); return(result); } }
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.NJRotateObject(item.Rotation); ((BasicAttach)numbermodel.Attach).Material[0].TextureID = 38 + Math.Min(Math.Max((int)item.Scale.X, 0), 9); result.AddRange(numbermodel.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("CON_REGULAR"), numbermeshes, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); result.AddRange(model.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("OBJ_REGULAR"), meshes, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); if (item.Selected) { result.AddRange(model.DrawModelTreeInvert(transform, meshes)); } transform.Pop(); return(result); }
public override List <RenderInfo> Render(SETItem item, Device dev, EditorCamera camera, MatrixStack transform) { List <RenderInfo> result = new List <RenderInfo>(); if (texs == null) { texs = ObjectHelper.GetTextures("objtex_common", texarr, dev); } //((BasicAttach)model.Children[childindex].Attach).Material[0].TextureID = itemTexs[Math.Min(Math.Max((int)item.Scale.X, 0), ItemBoxLength)]; transform.Push(); transform.NJTranslate(item.Position); result.AddRange(model.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, texs, meshes, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); if (item.Selected) { result.AddRange(model.DrawModelTreeInvert(transform, meshes)); } transform.Pop(); return(result); }
public override List <RenderInfo> Render(SETItem item, Device dev, EditorCamera camera, MatrixStack transform) { List <RenderInfo> result = new List <RenderInfo>(); if (texs == null) { texs = ObjectHelper.GetTextures("objtex_common", texarr, dev); } transform.Push(); transform.NJTranslate(item.Position); transform.NJRotateObject(item.Rotation.X, item.Rotation.Y - 0x8000, item.Rotation.Z); result.AddRange(model.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, texs, meshes)); if (item.Selected) { result.AddRange(model.DrawModelTreeInvert(transform, meshes)); } transform.Pop(); return(result); }
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); int RotY = item.Rotation.Y; if (RotY != 0x4000) { transform.NJRotateY(RotY - 0x4000); } transform.NJScale(1.5f, 1.5f, 1.5f); result.AddRange(model.DrawModelTree(dev, transform, ObjectHelper.GetTextures("OBJ_WINDY"), meshes)); if (item.Selected) { result.AddRange(model.DrawModelTreeInvert(transform, meshes)); } transform.Pop(); return(result); }
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.Push(); transform.NJRotateY(item.Rotation.Y); result.AddRange(model.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("SUPI_SUPI"), meshes)); if (item.Selected) { result.AddRange(model.DrawModelTreeInvert(transform, meshes)); } transform.Pop(); float sx = (item.Scale.X + 70) * 0.1f; transform.NJScale(sx, 0.02f, sx); result.AddRange(cylmdl.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, null, cylmsh, boundsByMesh: true)); transform.Pop(); return(result); }
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.Push(); transform.NJScale(4.5f, 4.5f, 4.5f); result.AddRange(sphere.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, null, spheremsh, boundsByMesh: true)); if (item.Selected) { result.AddRange(sphere.DrawModelTreeInvert(transform, spheremsh, boundsByMesh: true)); } 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); result.AddRange(whale.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("OBJ_BEACH"), whalemsh, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); if (item.Selected) { result.AddRange(whale.DrawModelTreeInvert(transform, whalemsh)); } transform.Pop(); return(result); }
internal void DrawLevel() { if (!loaded) { return; } d3ddevice.SetTransform(TransformType.Projection, Matrix.PerspectiveFovRH((float)(Math.PI / 4), panel1.Width / (float)panel1.Height, 1, cam.DrawDistance)); d3ddevice.SetTransform(TransformType.View, cam.ToMatrix()); Text = "X=" + cam.Position.X + " Y=" + cam.Position.Y + " Z=" + cam.Position.Z + " Pitch=" + cam.Pitch.ToString("X") + " Yaw=" + cam.Yaw.ToString("X") + " Interval=" + interval + (cam.mode == 1 ? " Distance=" + cam.Distance : "") + (animation != null ? " Animation=" + animation.Name + " Frame=" + animframe : ""); d3ddevice.RenderState.FillMode = EditorOptions.RenderFillMode; d3ddevice.RenderState.CullMode = EditorOptions.RenderCullMode; d3ddevice.Material = new Material { Ambient = Color.White }; d3ddevice.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.Black.ToArgb(), 1, 0); d3ddevice.RenderState.ZBufferEnable = true; d3ddevice.BeginScene(); //all drawings after this line EditorOptions.RenderStateCommonSetup(d3ddevice); MatrixStack transform = new MatrixStack(); if (animation != null) { RenderInfo.Draw(model.DrawModelTreeAnimated(d3ddevice, transform, Textures, meshes, animation, animframe), d3ddevice, cam); } else { RenderInfo.Draw(model.DrawModelTree(d3ddevice, transform, Textures, meshes), d3ddevice, cam); } if (selectedObject != null) { DrawSelectedObject(model, transform); } d3ddevice.EndScene(); //all drawings before this line d3ddevice.Present(); }
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); float X, Y; X = (item.Scale.X + 10) * 0.1f; Y = (item.Scale.Y + 10) * 0.1f; transform.NJScale(X, Y, X); result.AddRange(model.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, null, meshes, boundsByMesh: true)); if (item.Selected) { result.AddRange(model.DrawModelTreeInvert(transform, meshes, boundsByMesh: true)); } transform.Pop(); return(result); }
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); float ScaleX = item.Scale.X; float ScaleY = item.Scale.Y; if (ScaleX < ScaleY) { ScaleX = ScaleY; } transform.NJScale(ScaleX, ScaleY, item.Scale.Z); result.AddRange(model.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("OBJ_BEACH"), meshes)); if (item.Selected) { result.AddRange(model.DrawModelTreeInvert(transform, meshes)); } transform.Pop(); return(result); }
public override List <RenderInfo> Render(Device dev, EditorCamera camera, MatrixStack transform) { float dist = Direct3D.Extensions.Distance(camera.Position, Position.ToVector3()); if (dist > camera.DrawDistance) { return(EmptyRenderInfo); } List <RenderInfo> result = new List <RenderInfo>(); transform.Push(); transform.NJTranslate(0, offset, 0); transform.NJTranslate(Position); transform.NJRotateY(YRotation); result.AddRange(Model.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, LevelData.Textures[texture], Meshes)); if (Selected) { result.AddRange(Model.DrawModelTreeInvert(transform, Meshes)); } transform.Pop(); return(result); }
public override List <RenderInfo> Render(SETItem item, Device dev, EditorCamera camera, MatrixStack transform) { List <RenderInfo> result = new List <RenderInfo>(); transform.Push(); transform.NJTranslate(xpos ?? item.Position.X, ypos ?? item.Position.Y, zpos ?? item.Position.Z); transform.NJRotateObject(xrot ?? item.Rotation.X, yrot ?? item.Rotation.Y, zrot ?? item.Rotation.Z); if (model == null) { result.AddRange(ObjectHelper.RenderSprite(dev, transform, null, item.Position.ToVector3(), item.Selected)); } else { transform.NJScale(xscl ?? item.Scale.X, yscl ?? item.Scale.Y, zscl ?? item.Scale.Z); result.AddRange(model.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures(texture), meshes)); if (item.Selected) { result.AddRange(model.DrawModelTreeInvert(transform, meshes)); } } transform.Pop(); return(result); }
public override List <RenderInfo> Render(SETItem item, Device dev, EditorCamera camera, MatrixStack transform) { List <RenderInfo> result = new List <RenderInfo>(); v5 = Math.Min(Math.Max((int)item.Scale.Z, -1), 0); if (v5 < 0) { transform.Push(); transform.NJTranslate(item.Position); transform.NJRotateY(item.Rotation.Y); float Scale = item.Scale.X + 1.0f; transform.NJScale(Scale, Scale, Scale); result.AddRange(modelB.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("OBJ_WINDY"), meshesB)); if (item.Selected) { result.AddRange(modelB.DrawModelTreeInvert(transform, meshesB)); } transform.Pop(); return(result); } if (v5 >= 0) { transform.Push(); transform.NJTranslate(item.Position); transform.NJRotateY(item.Rotation.Y); float Scale = item.Scale.X + 1.0f; transform.NJScale(Scale, Scale, Scale); result.AddRange(modelA.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("OBJ_WINDY"), meshesA)); if (item.Selected) { result.AddRange(modelA.DrawModelTreeInvert(transform, meshesA)); } transform.Pop(); return(result); } return(result); }
public override void Render(Device dev, EditorCamera cam) { List <RenderInfo> result = new List <RenderInfo>(); MatrixStack transform = new MatrixStack(); // Sky transform.Push(); transform.NJTranslate(cam.Position.X, 0, cam.Position.Z); transform.NJRotateY(0xE000); result.AddRange(model1.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("CHAOS6_BG"), mesh1, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); transform.Pop(); // Moving cloud transform.Push(); dev.SetRenderState(RenderState.ZWriteEnable, true); dev.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha); dev.SetRenderState(RenderState.DestinationBlend, Blend.One); transform.NJTranslate(cam.Position.X, 2300.0f, cam.Position.Z); // Absolutely wrong but accurate to SADX! transform.NJScale(3.0f, 1.0f, 3.0f); result.AddRange(model2.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("CHAOS6_BG"), mesh2, EditorOptions.IgnoreMaterialColors, EditorOptions.OverrideLighting)); dev.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha); dev.SetRenderState(RenderState.DestinationBlend, Blend.InverseSourceAlpha); transform.Pop(); RenderInfo.Draw(result, dev, cam); }
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); transform.TranslateLocal(0, 110f, 0); result.AddRange(arch.DrawModelTree(dev, transform, ObjectHelper.GetTextures("OBJ_BEACH"), archmsh)); if (item.Selected) { result.AddRange(arch.DrawModelTreeInvert(transform, archmsh)); } transform.Pop(); transform.Push(); transform.NJTranslate(item.Position); transform.NJRotateY(item.Rotation.Y); transform.TranslateLocal(0, 0, 73f); result.AddRange(side1.DrawModelTree(dev, transform, ObjectHelper.GetTextures("OBJ_BEACH"), side1msh)); if (item.Selected) { result.AddRange(side1.DrawModelTreeInvert(transform, side1msh)); } transform.Pop(); transform.Push(); transform.NJTranslate(item.Position); transform.NJRotateY(item.Rotation.Y); transform.TranslateLocal(0, 0, -57f); result.AddRange(side2.DrawModelTree(dev, transform, ObjectHelper.GetTextures("OBJ_BEACH"), side2msh)); if (item.Selected) { result.AddRange(side2.DrawModelTreeInvert(transform, side2msh)); } transform.Pop(); return(result); }
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); result.AddRange(ballmodel.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, ObjectHelper.GetTextures("OBJ_REGULAR"), ballmeshes)); if (item.Selected) { result.AddRange(ballmodel.DrawModelTreeInvert(transform, ballmeshes)); } transform.Pop(); double v24 = item.Scale.X * 0.05000000074505806; transform.Push(); double v22 = item.Scale.X * 0.5 + item.Position.Y; transform.NJTranslate(item.Position.X, (float)v22, item.Position.Z); transform.NJScale(1.0f, (float)v24, 1.0f); result.AddRange(cylindermodel.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, null, cylindermeshes, boundsByMesh: true)); if (item.Selected) { result.AddRange(cylindermodel.DrawModelTreeInvert(transform, cylindermeshes, boundsByMesh: true)); } transform.Pop(); transform.Push(); transform.NJTranslate(item.Position.X, item.Position.Y + item.Scale.Z, item.Position.Z); result.AddRange(spheremodel.DrawModelTree(dev.GetRenderState <FillMode>(RenderState.FillMode), transform, null, spheremeshes, boundsByMesh: true)); if (item.Selected) { result.AddRange(spheremodel.DrawModelTreeInvert(transform, spheremeshes, boundsByMesh: true)); } transform.Pop(); return(result); }