public override void Create(Gem.PropertyBag Properties) { base.Create(Properties); var branch = new Gem.Render.BranchNode(); var Mesh = Gem.Geo.Gen.CreateQuad(); //Gem.Geo.Gen.Transform(Mesh, Matrix.CreateRotationZ((float)Math.PI)); Gem.Geo.Gen.Transform(Mesh, Matrix.CreateTranslation(0, 0.5f, 0)); Gem.Geo.Gen.Transform(Mesh, Matrix.CreateScale(Properties.GetPropertyAs<float>("width"), Properties.GetPropertyAs<float>("height"), 1)); Gem.Geo.Gen.Transform(Mesh, Matrix.CreateRotationX((float)(Math.PI / 8) * 3)); Mesh = Gem.Geo.Gen.FacetCopy(Mesh); Gem.Geo.Gen.CalculateTangentsAndBiNormals(Mesh); var shadowMesh = Gem.Geo.Gen.CreateQuad(); shadowMesh = Gem.Geo.Gen.FacetCopy(shadowMesh); Gem.Geo.Gen.CalculateTangentsAndBiNormals(shadowMesh); ShadowNode = new Gem.Render.MeshNode(shadowMesh, Properties.GetPropertyAs<Texture2D>("drop-shadow"), null, ShadowOrientation); ShadowNode.InteractWithMouse = false; MeshNode = new Gem.Render.MeshNode(Mesh, Properties.GetPropertyAs<Texture2D>("sprite"), Properties.GetPropertyAs<Texture2D>("normal-map"), Orientation); branch.Add(ShadowNode); branch.Add(MeshNode); Renderable = branch; MeshNode.AlphaMouse = true; }
public override void Create(Gem.PropertyBag Properties) { base.Create(Properties); Renderable = new Gem.Render.MeshNode( Properties.GetPropertyAs<Gem.Geo.Mesh>("mesh"), Properties.GetPropertyAs<Texture2D>("texture"), null, Orientation); }