Entity Object

These objects are accessible using the Overseer.GetEntity() series of methods. Assign the returned value from these methods to a variable to create a connection to one entity/symbol on the map. Using the methods and properties of this connection, the 3D object ( can then be affected.

Properties (Methods)

(activationLimit, activationType, clickRadius, layerID, location, mesh, name, priority, solid, tag, visible)

 

long activationLimit

   

Defines the number of times this entity can be activated. Each activation subtracts one from this value. For O3D_ENTER activation, setting this to –1 will call the activation function every 6 seconds. Use a high value for this activation type if entering this entity will always activate the object. For all other activation types, setting the value to –1 will result in unlimited activation.

 

long activationType

   

Indicates the ways this entity can be activated. The following flags are used and can be combined using the OR operator:

    O3D_NONE (Default) – cannot be activated
    O3D_ENTER Activated upon entering the entity. For 3D entities, this will be from crossing some of the entity's parts. For 2D entities, this will be moving inside the area.
    O3D_KEYWORD Activated by user keyword while inside the entity. For 3D entities, the user must be inside the entity 3D box. For 2D entities, this will be moving inside the area.
    O3D_CLICK Activated by a single, left-click of the user's mouse.
    O3D_DCLICK Activated by a double, left-click of the user's mouse.
 

double clickRadius

   

Establishes a radius around Entity where O3D_CLICK or O3D_DCLICK activation can occur. The value is a multiple of Entity horizontal radius and counts from the object border. For example, if a tower with horizontal radius of 50 feet has its clickRadius set equal to 0.5, the traveler would have to come within 25 feet of it before being able to activate the O3D_CLICK hotspot by clicking on the tower.

 

long layerID

   

The ID number of the layer containing this entity.

 

String location

   

The name of a Location object. The value of this string is pulled from the symbol attribute named "Location". Only those symbols with this attribute will have a location name. Use this name in Overseer.LoadMap calls to position the user at this location when the map is loaded. If an object possessing a "Location" attribute equal to "Startup" is found during processing of maps loaded as the result of user commands (not an Overseer.LoadMap call), such as initial map load, the user will automatically be positioned at this location when the map is loaded.

 

String mesh

   

A String containing the full path to the 3D model for this entity.

 

String name

   

A String containing the name of this entity. This is usually the symbol name from SYMDEF.

 

long priority

   

Read or set the priority of the entity. Changing the priority in real-time does not change an object's vertical position.

 

boolean solid

   

Does this object block movement such that it must be walked around or over as in Traveler mode or is it transparent such that it can be walked through.

 

long tag

   

The object tag number. The primary ID of each entity.

 

boolean visible

   

Is the entity visible or hidden.

Methods (Properties)

(Activate, Basement, CanActivate, Deactivate, GetBoundBoxMin, GetBoundBoxMax, GetCenter, GetChildrenCount, GetChildTag, GetFCWType,  GetAbsScale(),   GetOrientX, GetOrientY, GetOrientZ, GetPos, GetType, IsActive, LastActivationTick, MakeHotspot, RenderBox, RotateX, RotateY, RotateZ, SetAbsScale,  Scale, SetParent, SetPos, Shift, SetXBasis, SetYBasis, SetZBasis)

 

void Activate(long actFlag, String userCommand)

   

Manually call the ActivateEntityTag# function for this entity. As the function may contain code specifically written to detect the type of activation, provisions are made for passing these parameters to the function.

 

long Basement()

   

Returns the tag number of the basement object (the object this entity is resting on) for this entity, or 0 if it is resting on the ground.

 

boolean CanActivate()

   

Returns a boolean value indicating if this entity can activate, and thus have an activation function. If the entity is not a hotspot or has not been the target of thisEntity.assignTo it cannot be activated.

 

void Deactivate()

   

Manually call the DeActivateEntityTag# function for this entity.

 

Vector GetBoundBoxMin()
Vector GetBoundBoxMax()

   

Returns a Vector object representing the minimum/maximum points of the object's bound box. The Z coordinate is reversed, so the "highest" point is in the Min box.

 

Vector GetCenter()

   

Returns a Vector object containing the center coordinates for this entity. This method is available for 3D objects only.

 

long GetChildrenCount()

   

Returns the number of child entities this object has.

 

long GetChildTag(long childPos)

   

Returns the tag number of the specified child. childPos must be in the range 0 to GetChildrenCount(). Use Overseer.GetEntity(tag#) to access the child entity.

 

long GetFCWType()

   

The entity type of a 2D object as specified in the FCW file.

 

Vector GetOrientX()
Vector GetOrientY()
Vector GetOrientZ()

   

Returns a Vector object representing the orientation of each of the object's axis. You can use SetXBasis(double,double,double), SetYBasis(double,double,double)SetZBasis(double,double,double) to set this orientations.

 

Vector GetAbsScale()

    Returns absolute scale factor of this object.
 

Vector GetPos()

   

Returns a Vector object containing the x, y, and z coordinates for this entity. This method is available for 3D entities only.

 

long GetType()

   

Returns a number representing the entity's type (not the same as activationType). This number represents how the graphics engine is handling this entity and can be one of the following pre-defined types:

   

O3D_OBJECT
O3D_OBJECT2D
O3D_OBJECT3D
O3D_OBJECTPOLY
O3D_OBJECTTEXT

Generic entity that is rarely used
2D entity such as a polygon or multi-polygon
3D entity
Special type of 2D entity that is rarely used
Text entity

 

boolean IsActive()

   

Returns true if the entity is activated, false if deactivated. Deactivation for O3D_ENTER and O3D_KEYWORD activationType entities requires the user to exit the hotspot area. Deactivation for O3D_CLICK and O3D_DCLICK activationType entities requires the user to exit the clickRadius following activation.

 

long LastActivationTick()

   

Returns the Windows™ system time tick at which this entity was last activated. A tick is the number of milliseconds since Windows™ was started. The difference between two ticks will be the time period in milliseconds since this entity was activated.

 

void MakeHotspot()

   

Use this method to convert the entity into a hotspot. Following a call to this method, set activationType, activationLimit, clickRadius, and other hotspot specific properties. You must explicitly declare the functions ActivateEntityTag# and DeActivateEntityTag# for this hotspot. (Replace Tag# in the function name with the actual tag number of this entity.)

 

void RenderBox(boolean debugBox)

   

Enable or disable (default) the debug bound box around an object. Useful for debugging object areas visually.

 

void RotateX(double angle)
void RotateY(double angle)
void RotateZ(double angle)

   

Rotates the entity around an axis by the specified number of degrees.

 

void Scale(double scaleX, double scaleY, double scaleZ)

   

Scales this entity by the specified amount. For example, Scale(0.5,0.5,0.5) will make the object two times smaller while Scale(2,2,2) will make it two times larger.

 

void SetParent(Object parentObject)

   

Use this method to establish the parent object for this entity.

 

void SetPos(double x, double y, double z)

   

Used to set the absolute x, y, and z coordinates for this entity. This method is available for 3D entities only.

 

void  SetAbsScale(double x, double y, double z)

    Set absolute scale factor of the object. That will determine object size and scale relative to the map.
 

void Shift(double shiftX, double shiftY, double shiftZ)

   

Used to move the x, y, and z coordinates relative to the current location. This method is available for 3D entities only.



Copyright© 2001 Thought Guild Inc.