public override void Update() { mesh.SetPosition(Position.X, Position.Y, Position.Z); particle.SetGlobalPosition(Position.X, Position.Y, Position.Z); particle.SetGlobalRotation(Rotation.X, Rotation.Y, Rotation.Z); particle.SetGlobalScale(Scale.X, Scale.Y, Scale.Z); particle.Enable(Visible); }
public override void Initialize() { particle = Scene.CreateParticleSystem(); particle.Load(FileName); particle.SetGlobalPosition(Position.x, Position.y, Position.z); particle.SetGlobalScale(Scale.x, Scale.y, Scale.z); particle.Enable(Visible); // Register object in Lua. ScriptManager.SetGlobal(Name, this); }
//[Browsable(false)] //public override VECTOR3D Rotation { get; set; } public Particle(ICore core, string fileName) : base(core) { this.core = core; FileName = fileName; Visible = true; Name = core.GetName<Particle>(); TV_3DVECTOR position = Core.Camera.GetFrontPosition(10.0f); Position = new VECTOR3D(position.x, position.y, position.z); mesh = core.Scene.CreateBillboard(Helpers.GetTextureFromResource(core, Resources.particleBig), position.x, position.y, position.z, 1.0f, 1.0f); mesh.SetAlphaTest(true); particle = core.Scene.CreateParticleSystem(); particle.Load(fileName); particle.SetGlobalPosition(Position.X, Position.Y, Position.Z); particle.SetGlobalRotation(Rotation.X, Rotation.Y, Rotation.Z); particle.SetGlobalScale(Scale.X, Scale.Y, Scale.Z); UniqueId = mesh.GetMeshName(); }
//[Browsable(false)] //public override VECTOR3D Rotation { get; set; } public Particle(ICore core, string fileName) : base(core) { this.core = core; FileName = fileName; Visible = true; Name = core.GetName <Particle>(); TV_3DVECTOR position = Core.Camera.GetFrontPosition(10.0f); Position = new VECTOR3D(position.x, position.y, position.z); mesh = core.Scene.CreateBillboard(Helpers.GetTextureFromResource(core, Resources.particleBig), position.x, position.y, position.z, 1.0f, 1.0f); mesh.SetAlphaTest(true); particle = core.Scene.CreateParticleSystem(); particle.Load(fileName); particle.SetGlobalPosition(Position.X, Position.Y, Position.Z); particle.SetGlobalRotation(Rotation.X, Rotation.Y, Rotation.Z); particle.SetGlobalScale(Scale.X, Scale.Y, Scale.Z); UniqueId = mesh.GetMeshName(); }