Public Member Functions | |
ParaObject (CBaseObject *pObj) | |
const char * | GetType () |
get the Runtime class information of the object. | |
int | GetMyType () const |
get paraengine defined object type name. | |
bool | IsValid () const |
check if the object is valid | |
bool | IsAttached () const |
whether the object has been attached to the scene. | |
ParaAssetObject | GetPrimaryAsset () |
get the main asset object associated with this object. | |
void | GetPrimaryAsset_ (ParaAssetObject *pOut) |
this function shall never be called from the scripting interface. | |
ParaParamBlock | GetEffectParamBlock () |
get the parameter block of the effect (shader) associated with this object. | |
bool | IsPersistent () |
whether the object is persistent in the world. | |
void | SetPersistent (bool bPersistent) |
| |
bool | SaveToDB () |
save the current character to database according to the persistent property. | |
bool | equals (const ParaObject obj) const |
return true, if this object is the same as the given object. | |
const char * | ToString () const |
convert the object to object creation string. | |
const char * | ToString1 (const char *sMethod) const |
convert the object to string. | |
ParaAttributeObject | GetAttributeObject () |
get the attribute object associated with an object. | |
void | GetAttributeObject_ (ParaAttributeObject &output) |
for API exportation | |
void | CheckLoadPhysics () |
when this function is called, it ensures that the physics object around this object is properly loaded. | |
bool | IsStanding () |
whether the object has 0 speed. | |
bool | IsVisible () |
invisible object will not be drawn. | |
void | SetVisible (bool bVisible) |
set the visibility of this object. | |
bool | CheckAttribute (DWORD attribute) |
whether an object attribute is enabled. | |
void | SetAttribute (DWORD dwAtt, bool bTurnOn) |
enable or disable a given attribute. | |
void | SetPosition (float x, float y, float z) |
set world position. | |
void | GetPosition (float *x, float *y, float *z) |
get the world position of the object. | |
void | GetViewCenter (float *x, float *y, float *z) |
get the world position of the center of the view object. | |
void | OffsetPosition (float dx, float dy, float dz) |
offset the current object position by (dx,dy,dz) | |
void | SetFacing (float fFacing) |
set object facing around the Y axis. | |
float | GetFacing () |
get object facing around the Y axis | |
void | Rotate (float x, float y, float z) |
Rotate the object.This only takes effects on objects having 3D orientation, such as static mesh and physics mesh. | |
void | Scale (float s) |
set the scale of the object. | |
void | SetScaling (float s) |
float | GetScale () |
set the scale of the object. | |
void | SetScale (float s) |
set scale | |
object | GetRotation (const object &quat) |
this usually applies only to mesh object. | |
void | SetRotation (const object &quat) |
set the rotation as quaternion. | |
void | Reset () |
reset the object to its default settings. | |
void | SetDensity (float fDensity) |
body density. | |
float | GetDensity () |
get body density | |
float | GetPhysicsRadius () |
the biped is modeled as a cylinder or sphere during rough physics calculation. | |
void | SetPhysicsRadius (float fR) |
the biped is modeled as a cylinder or sphere during rough physics calculation. | |
string | GetName () const |
get the object name | |
const char * | GetName_ () const |
for .NET API use only.not thread safe. | |
void | SetName (const char *sName) |
set the object name
| |
void | SnapToTerrainSurface (int bUseNorm) |
snap to terrain surface. | |
bool | IsCharacter () const |
| |
bool | IsOPC () const |
| |
ParaCharacter | ToCharacter () |
return the ParaCharacter object, if this object is a biped typed scene object. | |
IGameObject * | ToGameObject () |
convert to game object. | |
void | AddEvent (const char *strEvent) |
add events to object to control the object, please refer to HLE for object event specifications. | |
void | AddChild (const ParaObject obj) |
attach the object as its child object. | |
void | EnablePhysics (bool bEnable) |
if this is a physics mesh object, this function will turn on or off the physics of the object. | |
bool | IsPhysicsEnabled () |
whether this is a physics mesh object | |
float | DistanceTo (ParaObject obj) |
get the distance with another object | |
object | GetViewBox (const object &output) |
get the view box. | |
bool | HasAttachmentPoint (int nAttachmentID) |
return whether this model has a given attachment point | |
void | GetAttachmentPosition (int nAttachmentID, float *x, float *y, float *z) |
return this object's attachment point e.g. | |
void | SetHomeZone (const char *sHomeZone) |
set the home zone of this object if any. | |
const char * | GetHomeZone () |
get the home zone of this object if any. | |
void | SetHeadOnText (const char *sText) |
set the text to be displayed on head on display | |
const char * | GetHeadOnText () |
Get the text to be displayed on head on display. | |
void | SetHeadOnUITemplateName (const char *sUIName) |
set which UI control the head on display will be used as a template for drawing the text it can be a single CGUIText Object or it can be a container with a direct children called "text" if this is "" or empty, the default UI template will be used. | |
const char * | GetHeadOnUITemplateName () |
get which UI control the head on display will be used as a template for drawing the text it can be a single CGUIText Object or it can be a container with a direct children called "text" if this is "" or empty, the default UI template will be used. | |
void | SetHeadOnTextColor (const char *color) |
set the text to be displayed on head on display | |
void | SetHeadOnOffest (float x, float y, float z) |
set the offset where head on display should be rendered relative to the origin or head of the host 3d object | |
void | GetHeadOnOffset (float *x, float *y, float *z) |
Get the offset where head on display should be rendered relative to the origin or head of the host 3d object. | |
void | ShowHeadOnDisplay (bool bShow) |
show or hide object's head on display | |
bool | IsHeadOnDisplayShown () |
whether the object head on display shall be visible | |
bool | HasHeadOnDisplay () |
whether the object contains head on display | |
int | GetXRefScriptCount () |
get the number of the script X reference instances | |
const char * | GetXRefScript (int nIndex) |
return xref script file path by index | |
void | GetXRefScriptPosition (int nIndex, float *x, float *y, float *z) |
get the 3D position in world space of the script object's origin | |
void | GetXRefScriptScaling (int nIndex, float *x, float *y, float *z) |
get the scaling of the object in both x,y,z directions | |
float | GetXRefScriptFacing (int nIndex) |
get the facing of the object in xz plane | |
const char * | GetXRefScriptLocalMatrix (int nIndex) |
get the local transform of the script object. | |
bool | IsSentient () |
whether the biped is sentient or not | |
float | GetSentientRadius () |
get the sentient radius. | |
float | GetPerceptiveRadius () |
get the perceptive radius. | |
void | SetPerceptiveRadius (float fNewRaduis) |
Set the perceptive radius. | |
int | GetNumOfPerceivedObject () |
return the total number of perceived objects. | |
ParaObject | GetPerceivedObject (int nIndex) |
get the perceived object by index. | |
bool | IsAlwaysSentient () |
whether the object is always sentient. | |
void | SetAlwaysSentient (bool bAlways) |
set whether sentient. | |
void | MakeSentient (bool bSentient) |
set the object to sentient. | |
void | UpdateTileContainer () |
update the tile container according to the current position of the game object. | |
void | MakeGlobal (bool bGlobal) |
make the biped global if it is not and vice versa. | |
bool | IsGlobal () |
whether the object is global or not. | |
void | SetGroupID (int nGroup) |
set the group ID to which this object belongs to. | |
void | SetSentientField (DWORD dwFieldOrGroup, bool bIsGroup) |
set the sentient field. | |
bool | IsSentientWith (const ParaObject &pObj) |
return true if the current object is sentient to the specified object. | |
void | SetMovableRegion (float center_x, float center_y, float center_z, float extent_x, float extent_y, float extent_z) |
Set the region within which the object can move. | |
void | GetMovableRegion (float *center_x, float *center_y, float *center_z, float *extent_x, float *extent_y, float *extent_z) |
get the region within which the object can move. | |
void | SetAnimation (int nAnimID) |
Set the current animation id. | |
int | GetAnimation () |
get the scaling. | |
string | GetOnEnterSentientArea () const |
when other game objects of a different type entered the sentient area of this object. | |
void | SetOnEnterSentientArea (const char *script) |
string | GetOnLeaveSentientArea () const |
when no other game objects of different type is in the sentient area of this object. | |
void | SetOnLeaveSentientArea (const char *script) |
string | GetOnClick () const |
when the player clicked on this object. | |
void | SetOnClick (const char *script) |
void | On_Click (DWORD nMouseKey, DWORD dwParam1, DWORD dwParam2) |
activate the OnClick | |
string | GetOnPerceived () const |
when other game objects of a different type entered the perceptive area of this object. | |
void | SetOnPerceived (const char *script) |
string | GetOnFrameMove () const |
called every frame move when this character is sentient. | |
void | SetOnFrameMove (const char *script) |
string | GetOnNetSend () const |
during the execution of this object, it may send various network commands to the server or client. | |
void | SetOnNetSend (const char *script) |
string | GetOnNetReceive () const |
when the network module receives packages from the network and it is about a certain game object. | |
void | SetOnNetReceive (const char *script) |
int | GetEffectHandle () |
Get the current shader handle used to render the object. | |
void | SetEffectHandle (int nHandle) |
Set the shader handle used to render the object. | |
int | AddReference (const ParaObject &maker, int nTag) |
add a new reference. | |
int | DeleteReference (const ParaObject &ref) |
delete a reference. | |
int | DeleteAllRefs () |
Deletes all references of this object. | |
int | GetRefObjNum () |
get the total number of references | |
ParaObject | GetRefObject (int nIndex) |
get the referenced object at the given index | |
int | GetNumReplaceableTextures () |
get the total number of replaceable textures, which is the largest replaceable texture ID. | |
ParaAssetObject | GetDefaultReplaceableTexture (int ReplaceableTextureID) |
get the default replaceable texture by its ID. | |
ParaAssetObject | GetReplaceableTexture (int ReplaceableTextureID) |
get the current replaceable texture by its ID. | |
bool | SetReplaceableTexture (int ReplaceableTextureID, ParaAssetObject pTextureEntity) |
set the replaceable texture at the given index with a new texture. | |
Public Attributes | |
CBaseObject * | m_pObj |
const char * ParaScripting::ParaObject::GetType | ( | ) |
get the Runtime class information of the object.
int ParaScripting::ParaObject::GetMyType | ( | ) | const |
get paraengine defined object type name.
TODO: This function is not implemented
bool ParaScripting::ParaObject::IsAttached | ( | ) | const |
whether the object has been attached to the scene.
ParaAssetObject ParaScripting::ParaObject::GetPrimaryAsset | ( | ) |
get the main asset object associated with this object.
the object may be invalid.
void ParaScripting::ParaObject::GetPrimaryAsset_ | ( | ParaAssetObject * | pOut | ) |
this function shall never be called from the scripting interface.
this is solely for exporting API. and should not be used from the scripting interface.
ParaScripting::ParaParamBlock ParaScripting::ParaObject::GetEffectParamBlock | ( | ) |
get the parameter block of the effect (shader) associated with this object.
bool ParaScripting::ParaObject::IsPersistent | ( | ) |
whether the object is persistent in the world.
If an object is persistent, it will be saved to the world's database. if it is not persistent it will not be saved when the world closes. Player, OPC, some temporary movie actors may by non-persistent; whereas NPC are usually persistent to the world that it belongs.
bool ParaScripting::ParaObject::SaveToDB | ( | ) |
save the current character to database according to the persistent property.
if the object is persistent, the action is to update or insert the character to db if the object is non-persistent, the action is to delete it from the database.
const char * ParaScripting::ParaObject::ToString | ( | ) | const |
convert the object to object creation string.
const char * ParaScripting::ParaObject::ToString1 | ( | const char * | sMethod | ) | const |
convert the object to string.
sMethod,: | it can be one of the following strings "create": generate script to create the object "update": generate script to update the object, useful for updating static physics object "delete": generate script to delete the object "loader": generate script to create the object in managed loader |
ParaAttributeObject ParaScripting::ParaObject::GetAttributeObject | ( | ) |
get the attribute object associated with an object.
void ParaScripting::ParaObject::CheckLoadPhysics | ( | ) |
when this function is called, it ensures that the physics object around this object is properly loaded.
It increases the hit count of these physics objects by 1. The garbage collector in the physics world may use the hit count to move out unused static physics object from the physics scene (Novodex). This function might be called for the current player, each active mobile object in the scene and the camera eye position. vCenter: the center of the object in world coordinates fRadius: the radius of the object within which all physics object must be active.
bool ParaScripting::ParaObject::IsStanding | ( | ) |
whether the object has 0 speed.
bool ParaScripting::ParaObject::IsVisible | ( | ) |
invisible object will not be drawn.
e.g. one can turn off the visibility of physics object.
void ParaScripting::ParaObject::SetVisible | ( | bool | bVisible | ) |
set the visibility of this object.
The visibility will recursively affect all its child objects.
bool ParaScripting::ParaObject::CheckAttribute | ( | DWORD | attribute | ) |
whether an object attribute is enabled.
attribute | object volume bit fields enum OBJECT_ATTRIBUTE { / two solid objects with sensor volume will cause environment simulator to / to generate sensor/collision event when they come in to contact. OBJ_VOLUMN_SENSOR = 1, / all child objects are in this object's volume OBJ_VOLUMN_CONTAINER = 0x1<<1, / solid objects(like biped) can be placed on its volume, provided / it's not already occupied by any solid objects from its children / when we solve two solid object collision, this is the field we check first. OBJ_VOLUMN_FREESPACE = 0x1<<2, / whether the object is isolated from its siblings. An isolated object / can overlap in physical space with all its siblings regardless of their solidity. / multiple scenes or terrains can be declared as ISOLATED object. Note, the object / is not isolated from its parent, though. OBJ_VOLUMN_ISOLATED = 0x1<<3, / the object has a perceptive radius that may be larger than the object's / collision radius. Currently only biped object might has this volume type OBJ_VOLUMN_PERCEPTIVE_RADIUS = 0x1<<4, / objects with this VIP volume type will trigger the plot of the scene in its view-culling radius. OBJ_VOLUMN_VIP = 0x1<<5, / Object invisible, the object is not drawn.but its physics may load. added by lxz 2006.3.5 OBJ_VOLUMN_INVISIBLE = 0x1<<6, / mask of the above bits. this field is never used externally. VOLUMN_MASK = 0x7f, / whether lights have effects on this object. MESH_USE_LIGHT = 0x1<<7, / whether to rotate the object around Y axis to let the object always facing the camera. MESH_BILLBOARDED= 0x1<<8, / whether it is a shadow receiver. MESH_SHADOW_RECEIVER= 0x1<<9, / whether it is a vegetation. MESH_VEGETATION= 0x1<<10, }; |
void ParaScripting::ParaObject::SetAttribute | ( | DWORD | dwAtt, | |
bool | bTurnOn | |||
) |
enable or disable a given attribute.
Below are some attributes. For more information please see BaseObject.h
/ two solid objects with sensor volume will cause environment simulator to / to generate sensor/collision event when they come in to contact. OBJ_VOLUMN_SENSOR = 1, / all child objects are in this object's volume OBJ_VOLUMN_CONTAINER = 0x1<<1, / solid objects(like biped) can be placed on its volume, provided / it's not already occupied by any solid objects from its children / when we solve two solid object collision, this is the field we check first. OBJ_VOLUMN_FREESPACE = 0x1<<2, / whether the object is isolated from its siblings. An isolated object / can overlap in physical space with all its siblings regardless of their solidity. / multiple scenes or terrains can be declared as ISOLATED object. Note, the object / is not isolated from its parent, though. OBJ_VOLUMN_ISOLATED = 0x1<<3, / the object has a perceptive radius that may be larger than the object's / collision radius. Currently only biped object might has this volume type OBJ_VOLUMN_PERCEPTIVE_RADIUS = 0x1<<4, / objects with this VIP volume type will trigger the plot of the scene in its view-culling radius. OBJ_VOLUMN_VIP = 0x1<<5, / Object invisible, the object is not drawn.but its physics may load. added by lxz 2006.3.5 OBJ_VOLUMN_INVISIBLE = 0x1<<6,
dwAtt | ||
bTurnOn,: | true to turn on, false to turn off. |
void ParaScripting::ParaObject::SetPosition | ( | float | x, | |
float | y, | |||
float | z | |||
) |
set world position.
Please note, for static object, it may make the quad tree terrain in which the object is located invalid. it may also make the physics engine panic.In such cases, one should call ParaScene.Attach() after chancing the position or rotation of a static mesh or physics object. If any of the following rule matches, the function is safe to use.
x,: | global x | |
y,: | global y | |
z,: | global z |
since the object has moved, we may need to update its location in the scene graph we only do this for static object.
void ParaScripting::ParaObject::GetPosition | ( | float * | x, | |
float * | y, | |||
float * | z | |||
) |
get the world position of the object.
This function takes no parameters. x,y,z are not input, but pure output. In the script, we can call it as below x,y,z = biped:GetPosition(); -- get the biped's position in Luabind, it is defined as .def("GetPosition", &ParaObject::GetPosition, pure_out_value(_2) + pure_out_value(_3) + pure_out_value(_4)) please note, y is the absolute position in world coordinate
void ParaScripting::ParaObject::GetViewCenter | ( | float * | x, | |
float * | y, | |||
float * | z | |||
) |
get the world position of the center of the view object.
This function takes no parameters. x,y,z are not input, but pure output. In the script, we can call it as below x,y,z = biped:GetViewCenter(); -- get the biped's center
void ParaScripting::ParaObject::OffsetPosition | ( | float | dx, | |
float | dy, | |||
float | dz | |||
) |
offset the current object position by (dx,dy,dz)
void ParaScripting::ParaObject::SetFacing | ( | float | fFacing | ) |
set object facing around the Y axis.
this function is safe to call for all kind of objects except the physics mesh object. for physics mesh object, one must call ParaScene.Attach() immediately after this function. for more information, please see SetPostion();
void ParaScripting::ParaObject::Rotate | ( | float | x, | |
float | y, | |||
float | z | |||
) |
Rotate the object.This only takes effects on objects having 3D orientation, such as static mesh and physics mesh.
The orientation is computed in the following way: first rotate around x axis, then around y, finally z axis. Note: this function is safe to call for all kind of objects except the physics mesh object. for physics mesh object, one must call ParaScene.Attach() immediately after this function. for more information, please see SetPostion();
x,: | rotation around the x axis. | |
y,: | rotation around the y axis. | |
z,: | rotation around the z axis. |
void ParaScripting::ParaObject::Scale | ( | float | s | ) |
set the scale of the object.
This function takes effects on both character object and mesh object. Note: this function is safe to call for all kind of objects except the physics mesh object. for physics mesh object, one must call ParaScene.Attach() immediately after this function. for more information, please see SetPostion();
s,: | This is a relative scale to its current size. Scaling applied to all axis.1.0 means original size. |
float ParaScripting::ParaObject::GetScale | ( | ) |
set the scale of the object.
This function takes effects on both character object and mesh object. Note: this function is safe to call for all kind of objects except the physics mesh object. for physics mesh object, one must call ParaScene.Attach() immediately after this function. for more information, please see SetPostion();
s,: | this is the absolute scale on the original mesh model. Scaling applied to all axis.1.0 means original size. |
void ParaScripting::ParaObject::SetScale | ( | float | s | ) |
object ParaScripting::ParaObject::GetRotation | ( | const object & | quat | ) |
this usually applies only to mesh object.
get the rotation as quaternion. e.g. local mat3x3 = obj:GetRotation({});
void ParaScripting::ParaObject::SetRotation | ( | const object & | quat | ) |
set the rotation as quaternion.
sRot | the rotational matrix is of the following format: {x,y,z,w,} |
void ParaScripting::ParaObject::Reset | ( | ) |
reset the object to its default settings.
void ParaScripting::ParaObject::SetDensity | ( | float | fDensity | ) |
body density.
The water density is always 1.0 in the game engine. So if it is above 1.0, it will sink in water; otherwise it will float on water surface. So if it is below 0.5, it will fly or glind in air falling down with little gravity; otherwise it will fall down with full gravity. A density of 0 or negative, means that the character can fly. The default value is 1.2. the following are some examples
fDensity |
float ParaScripting::ParaObject::GetPhysicsRadius | ( | ) |
the biped is modeled as a cylinder or sphere during rough physics calculation.
this function returns the radius of the cylinder or sphere.
void ParaScripting::ParaObject::SetPhysicsRadius | ( | float | fR | ) |
the biped is modeled as a cylinder or sphere during rough physics calculation.
this function set the radius of the cylinder or sphere.
const char * ParaScripting::ParaObject::GetName_ | ( | ) | const |
for .NET API use only.not thread safe.
void ParaScripting::ParaObject::SetName | ( | const char * | sName | ) |
set the object name
The good practice is that never change an object's name when it is attached to the scene.
: this function will not take effect, if the object can not be renamed, such as due to another global object with the same name.
sName,: | new name of the object |
void ParaScripting::ParaObject::SnapToTerrainSurface | ( | int | bUseNorm | ) |
snap to terrain surface.
Such as landscape trees, stones, etc. set bUseNorm to 1, if you want the norm to be aligned.
ParaCharacter ParaScripting::ParaObject::ToCharacter | ( | ) |
return the ParaCharacter object, if this object is a biped typed scene object.
the ParaCharacter interface offers more specific functions to control the behavior and appearance of the character object.
IGameObject * ParaScripting::ParaObject::ToGameObject | ( | ) |
convert to game object.
This function may return NULL.
void ParaScripting::ParaObject::AddEvent | ( | const char * | strEvent | ) |
add events to object to control the object, please refer to HLE for object event specifications.
Generally, one can use event to tell a biped to walk to a new position play a certain animation, speak some words, follow another biped, attack, etc.
strEvent,: | currently a biped object accepts the following events. A list of events (more will be coming in future release):
|
void ParaScripting::ParaObject::AddChild | ( | const ParaObject | obj | ) |
attach the object as its child object.
obj,: | the child object to attach |
void ParaScripting::ParaObject::EnablePhysics | ( | bool | bEnable | ) |
if this is a physics mesh object, this function will turn on or off the physics of the object.
object ParaScripting::ParaObject::GetViewBox | ( | const object & | output | ) |
get the view box.
e.g. local box = obj:GetViewBox({}); log(box.pos_x..box.pos_y..box.pos_z); return a table containing the following field:{pos_x, pos_y,pos_z,obb_x,obb_y,obb_z,} pos_x, pos_y,pos_z: is the point at the bottom center of the box. obb_x,obb_y,obb_z: is the size of the box.
bool ParaScripting::ParaObject::HasAttachmentPoint | ( | int | nAttachmentID | ) |
return whether this model has a given attachment point
nAttachmentID,: | see ATTACHMENT_ID. default to 0, which is general mount point. ATT_ID_MOUNT1-9(20-28) is another mount points |
void ParaScripting::ParaObject::GetAttachmentPosition | ( | int | nAttachmentID, | |
float * | x, | |||
float * | y, | |||
float * | z | |||
) |
return this object's attachment point e.g.
local x,y,z = obj:GetAttachmentPosition(0);
nAttachmentID,: | see ATTACHMENT_ID. default to 0, which is general mount point. ATT_ID_MOUNT1-9(20-28) is another mount points |
void ParaScripting::ParaObject::SetHomeZone | ( | const char * | sHomeZone | ) |
set the home zone of this object if any.
it may return NULL, if zone is not visible.
sHomeZone,: | if this is NULL, it will remove the zone. |
const char * ParaScripting::ParaObject::GetHomeZone | ( | ) |
get the home zone of this object if any.
it may return NULL or "", if zone is not visible.
void ParaScripting::ParaObject::SetHeadOnUITemplateName | ( | const char * | sUIName | ) |
set which UI control the head on display will be used as a template for drawing the text it can be a single CGUIText Object or it can be a container with a direct children called "text" if this is "" or empty, the default UI template will be used.
The default UI template is an invisible CGUIText control called "_HeadOnDisplayText_" By default, "_HeadOnDisplayText_" uses horizontal text alignment and system font.
const char * ParaScripting::ParaObject::GetHeadOnUITemplateName | ( | ) |
get which UI control the head on display will be used as a template for drawing the text it can be a single CGUIText Object or it can be a container with a direct children called "text" if this is "" or empty, the default UI template will be used.
The default UI template is an invisible CGUIText control called "_HeadOnDisplayText_" By default, "_HeadOnDisplayText_" uses horizontal text alignment and system font.
void ParaScripting::ParaObject::SetHeadOnTextColor | ( | const char * | color | ) |
set the text to be displayed on head on display
color,: | "r g b" or "r g b a", such as "0 255 0", "0 255 0 255" |
const char * ParaScripting::ParaObject::GetXRefScriptLocalMatrix | ( | int | nIndex | ) |
get the local transform of the script object.
It contains scale and rotation only the string returned by this function must be used at once and should not be saved. This function is also not thread-safe.
float ParaScripting::ParaObject::GetSentientRadius | ( | ) |
get the sentient radius.
usually this is much larger than the perceptive radius.
float ParaScripting::ParaObject::GetPerceptiveRadius | ( | ) |
get the perceptive radius.
void ParaScripting::ParaObject::SetPerceptiveRadius | ( | float | fNewRaduis | ) |
Set the perceptive radius.
int ParaScripting::ParaObject::GetNumOfPerceivedObject | ( | ) |
return the total number of perceived objects.
ParaObject ParaScripting::ParaObject::GetPerceivedObject | ( | int | nIndex | ) |
get the perceived object by index.
This function may return NULL.
bool ParaScripting::ParaObject::IsAlwaysSentient | ( | ) |
whether the object is always sentient.
The current player is always sentient
void ParaScripting::ParaObject::SetAlwaysSentient | ( | bool | bAlways | ) |
set whether sentient.
void ParaScripting::ParaObject::MakeSentient | ( | bool | bSentient | ) |
set the object to sentient.
bSentient,: | true to make sentient. if the object's sentient count is larger than 0, this function has no effect false, to remove the object from the sentient list. |
void ParaScripting::ParaObject::UpdateTileContainer | ( | ) |
update the tile container according to the current position of the game object.
This function is automatically called when a global object is attached.
void ParaScripting::ParaObject::MakeGlobal | ( | bool | bGlobal | ) |
make the biped global if it is not and vice versa.
bool ParaScripting::ParaObject::IsGlobal | ( | ) |
whether the object is global or not.
void ParaScripting::ParaObject::SetGroupID | ( | int | nGroup | ) |
set the group ID to which this object belongs to.
In order to be detected by other game object. Object needs to be in group 0 to 31. default value is 0
void ParaScripting::ParaObject::SetSentientField | ( | DWORD | dwFieldOrGroup, | |
bool | bIsGroup | |||
) |
set the sentient field.
A bit field of sentient object. from lower bit to higher bits, it matches to the 0-31 groups.
dwFieldOrGroup,: | this is either treated as field or group,depending on the bIsGroup parameter. | |
bIsGroup,: | if this is true, dwFieldOrGroup is treated as a group number of which will object will detect. if this is false, dwFieldOrGroup is treated as a bitwise field of which will object will detect. |
bool ParaScripting::ParaObject::IsSentientWith | ( | const ParaObject & | pObj | ) |
return true if the current object is sentient to the specified object.
If the object is always sentient, this function will always return true.
void ParaScripting::ParaObject::SetMovableRegion | ( | float | center_x, | |
float | center_y, | |||
float | center_z, | |||
float | extent_x, | |||
float | extent_y, | |||
float | extent_z | |||
) |
Set the region within which the object can move.
This function is not fully implemented on a per object basis.
void ParaScripting::ParaObject::GetMovableRegion | ( | float * | center_x, | |
float * | center_y, | |||
float * | center_z, | |||
float * | extent_x, | |||
float * | extent_y, | |||
float * | extent_z | |||
) |
get the region within which the object can move.
. This function takes no parameters. input are not input, but pure output. In the script, we can call it as below cx,cy,cz,ex,ey,ez = biped:GetMovableRegion(); -- get the biped's position please note, y is the absolute position in world coordinate
void ParaScripting::ParaObject::SetAnimation | ( | int | nAnimID | ) |
Set the current animation id.
nAnimID,: | 0 is default standing animation. 4 is walking, 5 is running. more information, please see AnimationID |
int ParaScripting::ParaObject::GetAnimation | ( | ) |
get the scaling.
string ParaScripting::ParaObject::GetOnEnterSentientArea | ( | ) | const |
when other game objects of a different type entered the sentient area of this object.
This function will be automatically called by the environment simulator.
string ParaScripting::ParaObject::GetOnLeaveSentientArea | ( | ) | const |
when no other game objects of different type is in the sentient area of this object.
This function will be automatically called by the environment simulator.
string ParaScripting::ParaObject::GetOnClick | ( | ) | const |
when the player clicked on this object.
This function will be automatically called by the environment simulator.
string ParaScripting::ParaObject::GetOnPerceived | ( | ) | const |
when other game objects of a different type entered the perceptive area of this object.
This function will be automatically called by the environment simulator.
string ParaScripting::ParaObject::GetOnFrameMove | ( | ) | const |
called every frame move when this character is sentient.
This is most likely used by active AI controllers, such as movie controller.
string ParaScripting::ParaObject::GetOnNetSend | ( | ) | const |
during the execution of this object, it may send various network commands to the server or client.
the network module will decide when to group these commands and send them over the network in one package. this function will be called when such network package is being prepared.
string ParaScripting::ParaObject::GetOnNetReceive | ( | ) | const |
when the network module receives packages from the network and it is about a certain game object.
Then this function will be automatically called. In this function, the game object may read the network packages and act accordingly.
int ParaScripting::ParaObject::GetEffectHandle | ( | ) |
Get the current shader handle used to render the object.
void ParaScripting::ParaObject::SetEffectHandle | ( | int | nHandle | ) |
Set the shader handle used to render the object.
Please note, object will be immediately rendered using the newly assigned shader in the next frame. shade handle in the range [0,2048] is reserved for ParaEngine's internal usage. CAUTION: setting a shader whose input is incompatible with the object's internal data presentation will cause the application to close.
nHandle,: |
int ParaScripting::ParaObject::AddReference | ( | const ParaObject & | maker, | |
int | nTag | |||
) |
add a new reference.
maker |
int ParaScripting::ParaObject::DeleteReference | ( | const ParaObject & | ref | ) |
delete a reference.
ref |
int ParaScripting::ParaObject::DeleteAllRefs | ( | ) |
Deletes all references of this object.
int ParaScripting::ParaObject::GetNumReplaceableTextures | ( | ) |
get the total number of replaceable textures, which is the largest replaceable texture ID.
but it does not mean that all ID contains valid replaceable textures. This function can be used to quickly decide whether the model contains replaceable textures. Generally we allow 32 replaceable textures per model.
ParaAssetObject ParaScripting::ParaObject::GetDefaultReplaceableTexture | ( | int | ReplaceableTextureID | ) |
get the default replaceable texture by its ID.
The default replaceable texture is the main texture exported from the 3dsmax exporter.
ReplaceableTextureID | usually [0-32) generally speaking, replaceable ID 0 is used for general purpose replaceable texture, ID 1 is for user defined. ID 2 is for custom skins. |
ParaAssetObject ParaScripting::ParaObject::GetReplaceableTexture | ( | int | ReplaceableTextureID | ) |
get the current replaceable texture by its ID.
if no replaceable textures is set before, this will return the same result as GetNumReplaceableTextures().
ReplaceableTextureID | usually [0-32) generally speaking, replaceable ID 0 is used for general purpose replaceable texture, ID 1 is for user defined. ID 2 is for custom skins. |
bool ParaScripting::ParaObject::SetReplaceableTexture | ( | int | ReplaceableTextureID, | |
ParaAssetObject | pTextureEntity | |||
) |
set the replaceable texture at the given index with a new texture.
this function will succeed regardless whether the mesh is initialized. Hence it can be used at loading time. because default instance of the mesh may use different replaceable texture set.
ReplaceableTextureID | usually [0-32) generally speaking, replaceable ID 0 is used for general purpose replaceable texture, ID 1 is for user defined. ID 2 is for custom skins. | |
pTextureEntity | The reference account of the texture entity will be automatically increased by one. |