public void GenerateCreateObjectRequestEvent(object sender, ObjectFactory.ObjectTypes objectType, string parameters) { if (CreateObjectRequest != null) { CreateObjectRequest(sender, new CreateObjectRequestEventArgs(objectType, parameters)); } }
public CreateCommand(ObjectFactory.ObjectTypes type, string initParameters) { objectType = type; parameters = initParameters; }
public CreateObjectRequestEventArgs( ObjectFactory.ObjectTypes objectType, string options) { type = objectType; parameters = options; }
public CreateObjectRequestEventArgs(ObjectFactory.ObjectTypes objectType, string options) { type = objectType; parameters = options; }
/// <summary> /// this guy here is the constructor that the emmitter calls. /// </summary> /// <param name="device">The global device</param> /// <param name="parent">The parent to this particle (the emitter)</param> /// <param name="birthFrame">The start frame for this particle</param> /// <param name="dynamicsList">Any dynamics applied to this particle</param> /// <param name="isDynamic">Whether or not this particle is dynamic</param> public Particle(Device device, IObject3D parent, int birthFrame, int deathFrame, ArrayList dynamicsList, bool isDynamic, ObjectFactory.ObjectTypes particleType, int directionalMedian, int directionalDeviation, Vector3 directionalBias, bool random) { // init this.device = device; this.Parent = parent; this.birthFrame = birthFrame; this.deathFrame = deathFrame; this.particleType = particleType; this.directionMedian = directionalMedian; this.directionDeviation = directionalDeviation; this.directionBias = directionalBias; this.isRandom = random; // determine which particle type we are using if (this.particleType == ObjectFactory.ObjectTypes.MeshBox) { mesh = Mesh.Box(device, 2.0f, 2.0f, 2.0f); } else if (this.particleType == ObjectFactory.ObjectTypes.MeshCylinder) { mesh = Mesh.Cylinder(device, 1.0f, 1.0f, 3.0f, 9, 9); } else if (this.particleType == ObjectFactory.ObjectTypes.MeshPolygon) { mesh = Mesh.Polygon(device, 1.0f, 6); } else if (this.particleType == ObjectFactory.ObjectTypes.MeshSphere) { mesh = Mesh.Sphere(device, 1.0f, 9, 9); } else if (this.particleType == ObjectFactory.ObjectTypes.MeshTeapot) { mesh = Mesh.Teapot(device); } else if (this.particleType == ObjectFactory.ObjectTypes.MeshTorus) { mesh = Mesh.Torus(device, 0.5f, 1.0f, 24, 15); } else { mesh = Mesh.Box(device, 1.0f, 1.0f, 1.0f); } name = ValidateName("Particle", true); this.velocity.X = GenerateMeanRandom(directionMedian, directionDeviation) * directionBias.X; this.velocity.Y = GenerateMeanRandom(directionMedian, directionDeviation) * directionBias.Y; this.velocity.Z = GenerateMeanRandom(directionMedian, directionDeviation) * directionBias.Z; startLocation.X = parent.Translation.X; startLocation.Y = parent.Translation.Y; startLocation.Z = parent.Translation.Z; startRotation.X = parent.Rotation.X; startRotation.Y = parent.Rotation.Y; startRotation.Z = parent.Rotation.Z; this.isDynamic = isDynamic; this.dynamicsList = dynamicsList; }