SolidKit3D.ObjectPosInfo class
From Solid Graphics Wiki
| ||||||||||
The ObjectPosInfo class is a class used in SolidKit Library to specify an 3D object position. This and the ObjectPosInfoList class are the only types required to "connect" non-SolidKit-Library datamodel objects with the Control3D class, so the Control3D object can be used to manipulate the "outside datamodel" objects.
Fields
| Field name | Type | Description |
| Translation | SolidKit3D.Vector | position of the object described by this ObjectPosInfo class instance |
| Rotation | SolidKit3D.Vector | rotation of the object |
| CenterPoint | SolidKit3D.Point | center point of the object rotation |
| BoundingSphereRadius | float | bounding sphere radius of the object. This field must be set by the calling application before pasing the object position/rotation for manipulation to the Control3D class. |
| Tag | object | Custom data pointer which can be set by an aplication to anything |
Methods
Note: Most of the below methods have two versions - one version uses the .NET math floating point operations to perform calculations. The second version uses method name postfix OGL and uses OpenGL functions to perform the calculations - which potentially allows graphics card hardware acceleration for the calculations.
| Method name | Description |
| Initialize | Initialize the field values. |
| ObjectToWorld | Depending on the used parameter type - the method translates a point coordinates from coordinate system relative to the object to world (scene) coordinates, or modifies given matrix so it can be used to perform such translation later on. |
| WorldToObject | Depending on the used parameter type - the method translates a point coordinates from world (scene) coordinates to coordinate system relative to the object, or modifies given matrix so it can be used to perform such translation later on. |
| ObjectVectorToWorldVector | Transforms a rotation vector from coordinate system relative to the object to rotation in world (scene) coordinate system. |
| WorldVectorToObjectVector | Transforms a rotation vector from world (scene) coordinate system to rotation in coordinate system relative to the object. |
| ObjectRotationToWorldRotation | Modifies given matrix so it can be used for transforming a rotation vector from coordinate system relative to the object to rotation in world (scene) coordinate system. |
| WorldRotationToObjectRotation | Modifies given matrix so it can be used to transform a rotation vector from world (scene) coordinate system to rotation in coordinate system relative to the object. |
| MatchPoint | Changes translation of the object so it's specified point moves to another point specified on another object. |
| MatchDirection | Changes rotation of the object so it's specified vector matches direction of another vector specified on another ObjectPosInfo object |
| RotateAroundAxis | Changes rotation of the object by rotating it by specified angle around specified axis vector. |
| RotateAroundAxisUsingAxisAngles | Changes rotation of the object by rotating it by specified angle around specified axis vector. The axis vector is specified by it's angles relative to coordinate system, rather than by vector values. |
| BoundingBox | Returns bounding box of a 3D object which position is specified by the ObjectPosInfo instance. The instance's boundingSphereRadius field value must be provided by the application in order to calculate the bounding box correctly. |
| Scale | Scales the instance's Translation, CenterPoint and BoundingSphereRadius fields by given factor. |
| SetCenterPoint | Set's new centerPoint for an object and recalculates the object's translation so the 3D object position relative to world/scene will remain unchanged. |
| LoadFromXML | Loads ObjectPosInfo instance's fields from given XmlReader. |
| SaveToXML | Saves ObjectPosInfo instance's fields to given XmlWriter object. |
Operators
The ObjectPosInfo class type has no operators.
See Also
SolidKit Library Documentation
