The SObjectInfo type is declared as follows:
The SObjectInfo structure describes information such as position, rotation, size, object’s ID and object’s parent object.
typedef struct _SObjectInfo
{
float Translation[ 3 ];
float Rotation[ 3 ];
float CenterPoint[ 3 ];
float Radius;
int ObjectId;
struct _SObjectInfo* Parent;
} SObjectInfo;
| Translation | Translation of the object in world coordinates, or object’s parent coordinates if the object has a parent. The ClassGL updates the translation while the object is being manipulated. |
| Rotation | Rotation of the object related either to world or object’s parent if the object has a parent. The ClassGL updates the rotation while the object is being manipulated. Common practice is to initialize Rotation values to 0.0 and use ClassGL object manipulation to set these values. |
| CenterPoint | Coordinates of object’s center point. The coordinates are local object’s coordinates. The Rotation uses this center point. |
| Radius | Minimum radius of a sphere which can contain the object. This information is used to determine rotation amount while object is being manipulated or while ClassGL uses SObjectInfo information in CopenGL::FitSelected method. |
| ObjectId | D of the object assigned by application. |
| Parent | Parent object of the object. If object has no parent, this item must be set to NULL. ClassGL supports hierarchical object model. Example of such object hierarchy can be a wheel, which is part of a car, which is carried by a ship. It means that if for example car is being manipulated, the ship’s position is not being changed, but the wheel moves together with the car. |
When an object is created, it is the application’s responsibility to associate SObjectInfo structure with the object and initially fill initial translation (usually 0,0,0), rotation (usually 0,0,0), center point (usually 0,0,0), object’s radius and parent into this structure.
While the object is being manipulated, ClassGL can change object’s translation and rotation depending on the manipulation.
![]()
| © 2001 Solid Graphics, All rights reserved. |
| To view this site, we require use of either Netscape Navigator 4.0 or higher or Internet Explorer 4.0 or higher. |