Exemple #1
0
 /// <summary>
 /// Remove a SimElement from this SimObject.
 /// </summary>
 /// <param name="element">The element to remove.</param>
 public void removeElement(SimElement element)
 {
     if (elements.Contains(element))
     {
         elements.Remove(element);
         element.setSimObject(null);
     }
 }
Exemple #2
0
 /// <summary>
 /// Update the scale of the SimObject.
 /// </summary>
 /// <param name="scale">The scale to set.</param>
 /// <param name="trigger">The object that triggered the update. Can be null.</param>
 public override void updateScale(ref Vector3 scale, SimElement trigger)
 {
     this.scale = scale;
     foreach (SimElement element in elements)
     {
         if (element != trigger)
         {
             element.alertUpdateScale(ref scale);
         }
     }
 }
Exemple #3
0
 /// <summary>
 /// Update the translation of the SimObject.
 /// </summary>
 /// <param name="translation">The translation to set.</param>
 /// <param name="trigger">The object that triggered the update. Can be null.</param>
 public override void updateTranslation(ref Vector3 translation, SimElement trigger)
 {
     this.translation = translation;
     foreach (SimElement element in elements)
     {
         if (element != trigger)
         {
             element.alertUpdateTranslation(ref translation);
         }
     }
 }
Exemple #4
0
 /// <summary>
 /// Update the rotation of the SimObject.
 /// </summary>
 /// <param name="rotation">The rotation to set.</param>
 /// <param name="trigger">The object that triggered the update. Can be null.</param>
 public override void updateRotation(ref Quaternion rotation, SimElement trigger)
 {
     this.rotation = rotation;
     foreach (SimElement element in elements)
     {
         if (element != trigger)
         {
             element.alertUpdateRotation(ref rotation);
         }
     }
 }
Exemple #5
0
 /// <summary>
 /// Update the position of the SimObject.
 /// </summary>
 /// <param name="translation">The translation to set.</param>
 /// <param name="rotation">The rotation to set.</param>
 /// <param name="trigger">The object that triggered the update. Can be null.</param>
 public override void updatePosition(ref Vector3 translation, ref Quaternion rotation, SimElement trigger)
 {
     this.translation = translation;
     this.rotation    = rotation;
     foreach (SimElement element in elements)
     {
         if (element != trigger)
         {
             element.alertUpdatePosition(ref translation, ref rotation);
         }
     }
 }
Exemple #6
0
 /// <summary>
 /// Add a SimElement to this SimObject.
 /// </summary>
 /// <param name="element">The element to add.</param>
 public override void addElement(SimElement element)
 {
     elements.Add(element);
     element.setSimObject(this);
 }
 /// <summary>
 /// Update the rotation of the SimObject.
 /// </summary>
 /// <param name="rotation">The rotation to set.</param>
 /// <param name="trigger">The object that triggered the update. Can be null.</param>
 public abstract void updateRotation(ref Quaternion rotation, SimElement trigger);
 /// <summary>
 /// Update the scale of the SimObject.
 /// </summary>
 /// <param name="scale">The scale to set.</param>
 /// <param name="trigger">The object that triggered the update. Can be null.</param>
 public abstract void updateScale(ref Vector3 scale, SimElement trigger);
 /// <summary>
 /// Update the translation of the SimObject.
 /// </summary>
 /// <param name="translation">The translation to set.</param>
 /// <param name="trigger">The object that triggered the update. Can be null.</param>
 public abstract void updateTranslation(ref Vector3 translation, SimElement trigger);
 /// <summary>
 /// Update the position of the SimObject.
 /// </summary>
 /// <param name="translation">The translation to set.</param>
 /// <param name="rotation">The rotation to set.</param>
 /// <param name="trigger">The object that triggered the update. Can be null.</param>
 public abstract void updatePosition(ref Vector3 translation, ref Quaternion rotation, SimElement trigger);
 /// <summary>
 /// Remove a SimElement as a weak element setting its sim object back to null.
 /// </summary>
 /// <param name="element">The element to remove.</param>
 public void removeWeakElement(SimElement element)
 {
     element.setSimObject(null);
 }
 /// <summary>
 /// Add an element that will take this sim object as an owner, but will
 /// not show up in the sim object itself. This means that the .Owner
 /// property of the element will report this sim object, but the object
 /// will not be accessible through this SimObject and will not be
 /// managed in any way by the SimObject.
 /// </summary>
 /// <param name="element">The element to add as a weak element.</param>
 public void addWeakElement(SimElement element)
 {
     element.setSimObject(this);
 }
 /// <summary>
 /// Add a SimElement to this SimObject.
 /// </summary>
 /// <param name="element">The element to add.</param>
 public abstract void addElement(SimElement element);