Simple data structure used to store a transform's data. Also provides functionality to read, write or compare data to a Transform, with a single line of code. Members two separate StoredTransform structures, one that hold local coordinate, one that hold world coordinates. When dealing with ACTUAL Transforms, all functions in this class will read BOTH world and local transforms, but only WRITE and COMPARE to one (which one, is selectable by parameter).

Public Member Functions

 StoredFullTransform (StoredTransform transform_to_copy)
 This constructor allows one to convert a StoredTransform struct into a StoredFullTransform struct. An implicit (cast from StoredTransform) operator would create ambiguities, and so one is NOT provided. NOTE: The transformation data from the parameter will be stored in BOTH the local and world members.
 
 StoredFullTransform (Transform transform_to_copy)
 Constructor requires a transform to copy data from. If no transform is provided it will use "unity" (no transformation for both local and world transformations). It will usually be simpler to just use the implicit (cast from Transform) operator than this constructor version.
 
void AssignToTransform (Transform transformToAssignTo, bool localNotWorld=true)
 Use to assign the values stored in this StoredTransform to an actual UnityEngine.Transform
 
override bool Equals (object obj)
 Generalized version of equality function. Determines if the object to compare is a Transform or StoredTransform. If so it compares each transform element for equality. If all element match it returns true. If the object is a transform, it's local coordinates will be compared.
 
bool Equals (StoredFullTransform trasf)
 Specific version of equality function used to compare with a Transform object. It will compare BOTH local and world coordinates for equality. Both must match for this function to return true.
 
bool Equals (StoredTransform trasf, bool localNotWorld)
 Specific version of equality function used to compare with a TransormStorage object. It will compare either local and world coordinates for equality. Both must match for this function to return true.
 
bool Equals (Transform unityTransform)
 Specific version of equality function used to compare with a Transform object. It will compare BOTH local and world coordinates for equality. Both must match for this function to return true.
 
override int GetHashCode ()
 This struct has dynamic values, and therefore should not be used as a key. This function will simply return a constant, so there is no performance gain from using Hash Tables.
 
void Reset ()
 Reset the stored values to unity/identity, which represents NO transformation.
 
override string ToString ()
 Converts the local and world transforms to strings.
 

Static Public Member Functions

static StoredFullTransform[] Cast (StoredTransform[] transformArray_to_copy)
 Convenience function used to convert an array of StoredTransform structs into FullransformStorage structs.
 
static StoredFullTransform GenNew ()
 static function to generate a new StoredTransform instance set to unity/identity. (This function exists because Structs have no generic constructors.)
 
static implicit operator StoredFullTransform (Transform transform_to_copy)
 Return a new instance of a StoredFullTransform struct. Requires a transform to copy data from. If no transform is provided, it use unity (no transformation for both local and world transformations.
 

Public Attributes

StoredTransform local
 this member stores the local values of the transform.
 
StoredTransform world
 this member stores the world values of the transform.
 

Properties

Vector3 localPosition [get, set]
 Accessor to read and write the position value stored in the local StoredTransform member.
 
Quaternion localRotation [get, set]
 Accessor to read and write the rotation value stored in the local StoredTransform member.
 
Vector3 localScale [get, set]
 Accessor to read and write the scale value stored in the local StoredTransform member.
 
Vector3 lossyScale [get, set]
 Accessor to read and write the scale value stored in the world StoredTransform member.
 
Vector3 position [get, set]
 Accessor to read and write the position value stored in the world StoredTransform member.
 
Quaternion rotation [get, set]
 Accessor to read and write the rotation value stored in the world StoredTransform member.
 
+ Collaboration diagram for StoredFullTransform: