public override void Draw3D(Camera3D camera, GameObjectTag DrawTag) { if (LineCount < 1) { return; } int i = 0; LinkedListNode <GameObject> n = Nodes.Value.First; if (n != null) { while (n.Next != null) { Path3DNode p = (Path3DNode)n.Value; LineVerteces[i++].Position = p.GetPosition(); p = (Path3DNode)n.Next.Value; LineVerteces[i++].Position = p.GetPosition(); n = n.Next; } } ShapeRenderer.Load(); ShapeRenderer.ColorEffectHolder.SetFromCamera(camera); ShapeRenderer.ColorEffectHolder.SetWorld(Matrix.Identity); ShapeRenderer.ColorEffectHolder.Apply(); ShapeRenderer.ColorEffectHolder.MyEffect.Parameters["ObjectColor"].SetValue(drawColor); Game1.graphics.GraphicsDevice.DrawUserIndexedPrimitives <VertexPositionColor>( PrimitiveType.LineList, LineVerteces, 0, LineCount * 2, LineIndicies, 0, LineCount); base.Draw3D(camera, DrawTag); }
new private static void Load() { if (!Loaded) { ShapeRenderer.Load(); Loaded = true; SphereModel = AssetManager.Load <Model>("Models/Deferred/Sphere"); ShadowProjection = Matrix.CreatePerspectiveFieldOfView(90 * 3.14159265f / 180, 1, 0.1f, 2000) * Matrix.CreateScale(-1, 1, 1); } }
public override void Create() { Delay = new FloatValue("Delay", 60); Sphere = new BoolValue("Sphere"); base.Create(); #if EDITOR if (ParentLevel.LevelForEditing) { AddTag(GameObjectTag._3DForward); ShapeRenderer.Load(); ApplyScale(Vector3.One * 200, Vector3.Zero, false); } #endif }
public override void Create() { SetCollisionShape(new OrientedBoxShape()); AddTag(GameObjectTag._3DSolid); base.Create(); #if EDITOR if (ParentLevel.LevelForEditing) { AddTag(GameObjectTag._3DForward); ShapeRenderer.Load(); ApplyScale(Vector3.One * 200, Vector3.Zero, false); } #endif }
public override void Create() { MyEvent = new EventValue("Event"); TriggeringObject = new ObjectValue("Trigger Object", typeof(Basic3DObject)); TriggeringType = new TypeValue("Trigger Type", typeof(Basic3DObject)); SetCollisionShape(new OrientedBoxShape()); Used = new BoolValue("Used"); AllowReset = new BoolValue("Allow Reset"); ResetDelay = new IntValue("Reset Delay", 1000); base.Create(); AddTag(GameObjectTag.Update); #if EDITOR if (ParentLevel.LevelForEditing) { AddTag(GameObjectTag._3DForward); ShapeRenderer.Load(); ApplyScale(Vector3.One * 200, Vector3.Zero, false); } #endif }