/// <summary> /// Adds an entity too the instanced mesh collection. /// </summary> /// <param name="entity"></param> public void Add(vxEntity3D entity) { instances.Add(entity); entity.InstanceSetParent = this; SetSize(); }
public void Add(vxEntity3D entity) { //TODO: Switch too vxModelVoxel ////First, this entity MUST have a non-null vxModel. //if (entity.vxModel != null) { // //Next add it to the overall Model List // EntityList.Add(entity); // //Now Add the Vertices too the Global List // foreach(Vector3 vec in entity.vxModel.Vertices) // Vertices.Add(vec); // //Now Normals // foreach(Vector3 norm in entity.vxModel.Normals) // Normals.Add(norm); // //Get the Texture Coordinates // foreach(Vector2 uvText in entity.vxModel.TextureUVCoordinate) // TextureUVCoordinate.Add(uvText); entity.MeshSet = this; }
/// <summary> /// Triggers a new 3D sound Based off of Entity /// </summary> public SoundEffectInstance Play3DSound(SoundEffect soundEffect, bool isLooped, vxEntity3D emitter) { ActiveSound activeSound = new ActiveSound(); // Fill in the instance and emitter fields. activeSound.Instance = soundEffect.CreateInstance(); activeSound.Instance.IsLooped = isLooped; activeSound.Emitter = emitter; // Set the 3D position of this sound, and then play it. Apply3D(activeSound); activeSound.Instance.Volume = vxEngine.Profile.Settings.Audio.Double_SFX_Volume; activeSound.Instance.Play(); // Remember that this sound is now active. activeSounds.Add(activeSound); return(activeSound.Instance); }
/// <summary> /// Removes the specified Entity from the collection. /// </summary> /// <param name="entity"></param> public void Remove(vxEntity3D entity) { instances.Remove(entity); SetSize(); }