Package populus :: Module Avatar :: Class Avatar
[frames] | no frames]

Class Avatar


Refactoring Phase 2: new Avatar class.

Nested Classes

Inherited from ReactiveMind.ReactiveMind: Motivation

Instance Methods
 
__repr__(self)
repr(x)

Inherited from ReactiveMind.ReactiveMind: addMotivation, createSteeringBehavior, forget, getBehaviorPriority, getBehaviorTime, getBehaviorTimeMarker, getBehaviorWeight, investigateBehavior, memorize, modifyBehaviorPriority, modifyBehaviorWeight, plugPerception, remember, requestStartBehavior, requestStopAllBehaviors, requestStopBehavior, setBehaviorTimeMarker, setBehaviorTimer, startSteeringBehavior, stopBehaviorLater, stopSteeringBehavior

Inherited from SteerLibrary.SteerLibraryMixIn: convertForceIntoCosts, initSetOfCosts, spanDirections, steerForArrival, steerForAvoidObstacle, steerForAvoidObstacles, steerForAvoidObstaclesNEW, steerForCohesion, steerForFacing, steerForFlee, steerForKeepGroupSpace, steerForMinDistance, steerForSeek

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Inherited from direct.fsm.FSM.FSM: cleanup, defaultEnter, defaultExit, defaultFilter, demand, filterOff, forceTransition, getCurrentOrNextState, getStateChangeEvent, isInTransition, request, requestNext, requestPrev, setBroadcastStateChanges, setStateArray

Inherited from direct.showbase.DirectObject.DirectObject: accept, acceptOnce, addTask, classTree, detectLeaks, doMethodLater, getAllAccepting, ignore, ignoreAll, isAccepting, isIgnoring, removeAllTasks, removeTask

    Getters and Setters
string
getName(self)
Return the avatar's name.
string
getDisplayName(self)
Return the name displayed in the name-bar.
NodePath
getNodePath(self)
Return the avatar's prime node in the Panda3D SceneGraph.
NodePath
getCenterNodePath(self)
Return the avatar's center of mass node in the Panda3D SceneGraph.
NodePath
getHeadNodePath(self)
Return the avatar's head node in the Panda3D SceneGraph.
NodePath
getEyesNodePath(self)
Return avatar's eyes node in the Panda3D SceneGraph.
NodePath
getFeetNodePath(self)
Return the avatar's feet node in the Panda3D SceneGraph.
PhysActor
getPhysActor(self)
Return the PhysX Actor representing the avatar in PhysX.
PhysShape
getPhysShape(self)
Return the PhysX Shape of the avatar's PhysX Actor.
Point3
getPos(self)
Return the avatar position in global coordinates.
Vec3
getHpr(self)
Return the avatar's orientation as a triple of Euler angles.
string
getState(self)
Return the state of the finite state machine.
bool
getIsPlayer(self)
Return true if the avatar is the player; false otherwise.
bool
getShowStats(self)
Return true if the ShowStatsDisplay is open.
Avatar
getLookingAt(self)
Return the target the avatar is currently looking at.
Vec3
getLocalVector(self, v)
Convert a vector into avatar's local coordinates.
Point3
getLocalPoint(self, p)
Convert a point into avatar's local coordinates.
Vec3
getGlobalVector(self, v)
Convert a local vector into global coordinates.
Point3
getGlobalPoint(self, p)
Convert a local point into global coordinates.
Vec4
getColor(self)
Get the avatar color.
AgentProfile
getProfile(self)
Get the avatar profile for IdleGaze behavior.
AgentPreferences
getPreferences(self)
Get the avatar preferences for the IdleGaze behavior.
 
setPos(self, pos)
Translate the avatar to a given position.
 
setH(self, deg)
Set the avatar heading angle.
 
setDisplayName(self, displayName)
Set the name to display on top of the avatar's head.
 
setConversation(self, conv)
Set the conversation in which the avatar is participating to.
 
setIsPlayer(self, state)
Set the avatar's isPlayer flag.
 
setShowStats(self, state)
Set the avatar ShowStats flag.
 
setColor(self, color)
Set the avatar color.
 
setProfile(self, profile)
Set avatar profile for the IdleGaze behavior.
 
setPreferences(self, preferences)
Set avatar preferences for the IdleGaze behavior.

Inherited from MotionModel.SimpleHumanBody: bodyMat, eyesForward, eyesLocalMat, eyesLocalPos, eyesMat, eyesMaxAngExt, eyesMaxAngSpeed, eyesPosition, eyesRotation, eyesSide, eyesUp, forward, headForward, headLocalMat, headLocalPos, headMat, headMaxAngExt, headMaxAngSpeed, headPosition, headRadius, headRotation, headSide, headTurning, headUp, heading, height, mass, maxAngSpeed, maxForce, maxSpeed, orientation, pitch, position, radius, roll, setBodyDirectionMotivation, setBodyMotionMotivation, setEyesDirectionMotivation, setEyesLocalPos, setEyesMaxAngExt, setEyesMaxAngSpeed, setEyesPosition, setHeadDirectionMotivation, setHeadLocalPos, setHeadMaxAngExt, setHeadMaxAngSpeed, setHeadPosition, setHeadRadius, setHeadTurning, setHeading, setHeight, setMass, setMaxAngSpeed, setMaxForce, setMaxSpeed, setPitch, setPosition, setRadius, setRoll, setTurning, setVelocity, side, speed, turning, up, velocity

    General Chechers
 
isPerson(self)
Assert that an avatar is a person.
bool
isRemoved(self)
Check if the current instance is been removed.
    State Checkers
bool
isStanding(self)
Check wether the avatar is standing.
bool
isRunning(self)
Check wether the avatar is running.
bool
isAttentive(self)
Check wether the avatar is attentive and focused on a human-like target.
bool
isConversating(self)
Check wether the avatar participates in a conversation.
bool
isLookingAt(self)
Check wether the avatar is looking at something.
bool
isFocused(self)
Check wether the avatar is attentive and focused on a human-like target.
bool
isCallingAttention(self)
Check wether the avatar calls for attention.
bool
isMoving(self)
Check wether the Avatar is moving or not.
bool
hasMutualAttention(self)
Check wether the avatar got mutual attention with another Avatar.
bool
hasMutualGaze(self)
Check wether the avatar got mutual gaze with another Avatar.
bool
hasUtteranceSystem(self)
Check wether the avatar has established an utterance system.
    Turntaking Setters and Getters
 
setTTMind(self, new_mind)
Set a turn taking mind for the avatar.
    For the Authoring Tool
float or None
getConversationPrivacy(self)
Return to a CADIAPopulus editor the avatar conversation's privacy level.
 
setConversationPrivacy(self, prv)
Set from a CADIAPopulus editor the avatar conversation's privacy level.
float
getPersonalDistance(self)
Return to a CADIAPopulus editor the avatar's personal distance.
 
setPersonalDistance(self, dist)
Set from a CADIAPopulus editor the avatar's personal distance.
float
getPersonalDistanceWeight(self)
Return to a CADIAPopulus editor the weight of the KeepPersonalDistance reactive behavior.
 
setPersonalDistanceWeight(self, w)
Set from a CADIAPopulus editor the weight of the KeepPersonalDistance reactive behavior.
float
getEqualityWeight(self)
Return to a CADIAPopulus editor the weight of the KeepConversationalEquality reactive behavior.
 
setEqualityWeight(self, w)
Set from a CADIAPopulus editor the weight of the KeepConversationalEquality reactive behavior.
float
getCohesionWeight(self)
Return to a CADIAPopulus editor the weight of the KeepConversationalCohesion reactive behavior.
 
setCohesionWeight(self, w)
Set from a CADIAPopulus editor the weight of the KeepConversationalCohesion reactive behavior.
float
getTestWeight(self)
Return to a CADIAPopulus editor the weight of the Test2Conversational reactive behavior.
 
setTestWeight(self, w)
Set from a CADIAPopulus editor the weight of the Test2Conversational reactive behavior.
float
getTest2Weight(self)
Return to a CADIAPopulus editor the weight of the Test2Conversational reactive behavior.
 
setTest2Weight(self, w)
Set from a CADIAPopulus editor the weight of the Test2Conversational reactive behavior.
float
getObstacleAvoidanceSafeRadius(self)
Return to a CADIAPopulus editor the safe radius of the ObstaclesAvoidance reactive behavior.
 
setObstacleAvoidanceSafeRadius(self, r)
Set from a CADIAPopulus editor the safe raidus of the ObstaclesAvoidance reactive behavior.
    User Issued Commands
 
setDestination(self, point)
Call this method whenever the user wants to move his avatar to a given destination point.
 
setInteraction(self, other)
Call this method whenever the user wants to interact with another Avatar.
 
setText(self, sentence)
Call this method whenever the user typed some text and wants his avatar to say something.
    Avatar Behaviors
 
wantTurn(self)
The avatar wants to call attention and get the turn in a conversation.
 
say(self, text, stop=None)
The avatar sais something to his target.
 
addressedBy(self, other, text)
Address the avatar with a given sentence.
 
checkForReply(self, task)
Check how many replies the avatar have got during an exchanging of utterances with another avatar.
 
closeUtteranceSystem(self)
Close the avatar utterance system by setting the number replies to zero.
 
initiateConversation(self, guest)
Initiate a conversation with another guest avatar.
 
inviteToConversation(self, conversation)
Invite the avatar to join a given ongoing conversation.
 
joinConversation(self, conversation)
Directly join the avatar to an ongoing conversation.
 
disjoinConversation(self)
Get the avatar out of his conversation.
 
setPropAsTarget(self, prop, engine)
Undocumented...
 
purchaseAtCounter(self, counter)
Undocumented...
 
purchaseAtCounterWith(self, counter, companyList)
Undocumented...
 
joinQueue(self, qqueue)
Start MoveToQueue behavior.
 
leaveQueue(self, queue)
Go to some spot away from the queue, fixed for now.
 
fakeConversation(self, task)
Utter 'blah' continuously, just for debugging.
 
blink(self, manualBlink=None, blinkCount=0)
The avatar's blinking behaviour is set.
    FSM State Transition Operations
 
enterRun(self)
This method is automatically called everytime the avatar's state machine enters the state Run.
 
enterStand(self)
This method is automatically called everytime the avatar's state machine enters the state Stand.
 
enterAttentive(self)
This method is automatically called everytime the avatar's state machine enters the state Attentive.
 
enterConversation(self)
This method is automatically called everytime the avatar's state machine enters the state Conversation.
 
exitConversation(self)
This method is automatically called everytime the avatar's state machine exits the state Conversation.
    Debug Operations
 
showVision(self)
Show vision sensor annotations.
 
showProxemics(self)
Show proxemics sensor annotations.
 
inspect(self, inspection=True)
Render the avatar's model in wireframe and shows his internal motion model.
    Update
 
update(self, dt)
Call this to update the avatar's state.
 
updateWhenRemote(self, dt)
Use this instead of Avatar.update when the avatar is remotely controlled.
    Behavior Interfaces

Inherited from ReactiveLibrary.SocialTerritorialMind: doIdleGaze, focusOn, gazeAt, glanceAt, turnHeadToward, turnToward

Inherited from ReactiveLibrary.NavigationalMind: goTo, moveTo

    Constructor and Destructor
 
__init__(self, engine, name='Avatar', parent=render, pos2D=(0, 0))
The constructor create an instance of ReactiveHuman and wires up mind's motivations with body's receptors.

Inherited from ReactiveAgents.ReactiveHuman: remove

Static Methods

Inherited from SteerLibrary.SteerLibraryMixIn: addCost, getCost, getMagnitude, setCost, setMagnitude

Class Variables
float MODEL_SCALE_FACTOR = 0.00538889
An empirical scaling factor that depends from the size of the model.
string MODEL_PATH = 'Models/Humanoid/LowPolyEgg/Humanoid.egg'
Avatar model's path.
string ANIM_IDLE_PATH = 'Models/Humanoid/LowPolyEgg/Humanoid_idle.egg'
Avatar idle animation's path.
string ANIM_WALKING_PATH = 'Models/Humanoid/LowPolyEgg/Humanoid_walki...
Avatar walking animation's path.
string ANIM_STEPLEFT_PATH = 'Models/Humanoid/LowPolyEgg/Humanoid_step...
Avatar step left animation's path.
string ANIM_STEPRIGHT_PATH = 'Models/Humanoid/LowPolyEgg/Humanoid_ste...
Avatar step right animation's path.
string ANIM_STEPBACK_PATH = 'Models/Humanoid/LowPolyEgg/Humanoid_back...
Avatar step back animation's path.
string ANIM_WANTSPEAK_PATH = 'Models/Humanoid/LowPolyEgg/Humanoid_iWa...
Avatar want-to-speak animation's path.
string ANIM_SPEAKING_PATH = 'Models/Humanoid/LowPolyEgg/Humanoid_spea...
Avatar speaking animation's path.
string ANIM_BLINK_PATH = 'Models/Humanoid/LowPolyEgg/Humanoid_blink.egg'
Avatar blink animation's path.
string ANIM_OPENMOUTH_PATH = 'Models/Humanoid/LowPolyEgg/Humanoid_ope...
Avatar open mouth animation's path.
string NAMBAR_FONT_PATH = 'Models/font/lynx.egg'
Avatar name-bar font's path.
Vec4 DEFAULT_COLOR = Vec4(0.68, 0.68, 0.98, 1)
Avatar default color.

Inherited from direct.fsm.FSM.FSM: SerialNum, defaultTransitions, notify

Properties

Inherited from object: __class__

Method Details

__init__(self, engine, name='Avatar', parent=render, pos2D=(0, 0))
(Constructor)

 

The constructor create an instance of ReactiveHuman and wires up mind's motivations with body's receptors.

Overrides: direct.showbase.DirectObject.DirectObject.__init__

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: direct.fsm.FSM.FSM.__repr__

getName(self)

 

Return the avatar's name.

Returns: string
The avatar's name.

getDisplayName(self)

 

Return the name displayed in the name-bar.

Returns: string
The name visualized on top of the avatar's head.

getNodePath(self)

 

Return the avatar's prime node in the Panda3D SceneGraph.

Returns: NodePath
The avatar's prime node.

Note: The NodePath is located on the avatar's feet.

getCenterNodePath(self)

 

Return the avatar's center of mass node in the Panda3D SceneGraph.

Returns: NodePath
The avatar's central node.

Note: The NodePath localizes the center of mass of the Avatar's body.

getHeadNodePath(self)

 

Return the avatar's head node in the Panda3D SceneGraph.

Returns: NodePath
The avatar's head node.

Note: The NodePath localizes the head on the avatar's model.

getEyesNodePath(self)

 

Return avatar's eyes node in the Panda3D SceneGraph.

Returns: NodePath
The avatar's eyes node.

Note: The NodePath localizes the eyes on the avatar's model.

getFeetNodePath(self)

 

Return the avatar's feet node in the Panda3D SceneGraph.

Returns: NodePath
The avatar's feet node.

Note: The NodePath localizes the feet on the avatar's model.

getPhysActor(self)

 

Return the PhysX Actor representing the avatar in PhysX.

Returns: PhysActor
The avatar's PhysX Actor.

getPhysShape(self)

 

Return the PhysX Shape of the avatar's PhysX Actor.

Returns: PhysShape
The shape of the avatar's PhysX Actor.

getPos(self)

 

Return the avatar position in global coordinates.

Returns: Point3
The position in global coordinates.

getHpr(self)

 

Return the avatar's orientation as a triple of Euler angles.

Returns: Vec3
A vector with the three avatar's Euler angles.

getState(self)

 

Return the state of the finite state machine.

Returns: string
The avatar's state.

getIsPlayer(self)

 

Return true if the avatar is the player; false otherwise.

Returns: bool
True if the avatar is the player; false otherwise.

getShowStats(self)

 

Return true if the ShowStatsDisplay is open.

Returns: bool
True if the ShowStatsDisplay is open; false otherwise.

getLookingAt(self)

 

Return the target the avatar is currently looking at.

Returns: Avatar
The other avatar looked by this avatar

getLocalVector(self, v)

 

Convert a vector into avatar's local coordinates.

Parameters:
  • v (Vec3 param v: A vector in global coordinates.)
Returns: Vec3
The same vector but in avatar's local coordinates.

getLocalPoint(self, p)

 

Convert a point into avatar's local coordinates.

Parameters:
  • v (Point3 param v: A point in global coordinates.)
Returns: Point3
The same point but in avatar's local coordinates.

getGlobalVector(self, v)

 

Convert a local vector into global coordinates.

Parameters:
  • v (Vec3 param v: A vector in avatar's local coordinates.)
Returns: Vec3
The same vector but in global coordinates.

getGlobalPoint(self, p)

 

Convert a local point into global coordinates.

Parameters:
  • v (Point3 param v: A point in avatar's local coordinates.)
Returns: Point3
The same point but in global coordinates.

getColor(self)

 

Get the avatar color.

Returns: Vec4
The avatar color.

getProfile(self)

 

Get the avatar profile for IdleGaze behavior.

Returns: AgentProfile
The avatar IdleGaze behavior profile.

getPreferences(self)

 

Get the avatar preferences for the IdleGaze behavior.

Returns: AgentPreferences
The avatar IdleGaze behavior preferences.

setPos(self, pos)

 

Translate the avatar to a given position.

Parameters:
  • pos (Point3) - A point in global coordinates.

setH(self, deg)

 

Set the avatar heading angle.

Parameters:
  • deg (float) - An angle in degree.

setDisplayName(self, displayName)

 

Set the name to display on top of the avatar's head.

Parameters:
  • displayName (string) - The name to visualize.

setConversation(self, conv)

 

Set the conversation in which the avatar is participating to.

Parameters:
  • conv (Conversation) - The conversation in which the avatar is currently involved.

Attention: The avatar can participate only in one conversation at the time.

setIsPlayer(self, state)

 

Set the avatar's isPlayer flag.

Parameters:
  • state (bool) - Value of the IsPlayer flag.

Note: If the avatar is the player and the stats are displayed then hide the name on top of his head.

To Do: Reconsider it! Too much responsability to be a setter.

setShowStats(self, state)

 

Set the avatar ShowStats flag.

Parameters:
  • state (bool) - Value of the ShowStats flag.

Note: If the avatar is the player and the stats are displayed then hide the name on top of his head.

To Do: Reconsider it! Too much responsability to be a setter.

setColor(self, color)

 

Set the avatar color.

Parameters:
  • color (Vec4) - A new color of the avatar.

setProfile(self, profile)

 

Set avatar profile for the IdleGaze behavior.

Parameters:

setPreferences(self, preferences)

 

Set avatar preferences for the IdleGaze behavior.

Parameters:

isPerson(self)

 

Assert that an avatar is a person.

Returns:
always True.

isRemoved(self)

 

Check if the current instance is been removed.

Returns: bool
True if removed; false otherwise.

isStanding(self)

 

Check wether the avatar is standing.

Returns: bool
True if the avatar stands; false otherwise.

isRunning(self)

 

Check wether the avatar is running.

Returns: bool
True if the avatar runs; false otherwise.

isAttentive(self)

 

Check wether the avatar is attentive and focused on a human-like target.

Returns: bool
True if the avatar is attentive; false otherwise.

isConversating(self)

 

Check wether the avatar participates in a conversation.

Returns: bool
True if the avatar participants in a conversation; false otherwise.

isLookingAt(self)

 

Check wether the avatar is looking at something.

Returns: bool
True if the avatar looks an entity; false otherwise.

isFocused(self)

 

Check wether the avatar is attentive and focused on a human-like target.

Returns: bool
True if the avatar is focused; false otherwise.

isCallingAttention(self)

 

Check wether the avatar calls for attention.

Returns: bool
True if the avatar calls attention; false otherwise.

isMoving(self)

 

Check wether the Avatar is moving or not.

An avatar moves whenever his body or head move.

Returns: bool
True if the avatar moves; false otherwise.

hasMutualAttention(self)

 

Check wether the avatar got mutual attention with another Avatar.

Mutual attention means that both avatars are focused on each other.

Returns: bool
True if the avatar has mutual attention; false otherwise.

hasMutualGaze(self)

 

Check wether the avatar got mutual gaze with another Avatar.

Mutual gaze means that both avatars look each other.

Returns: bool
True if the avatar has mutual gaze; false otherwise.

hasUtteranceSystem(self)

 

Check wether the avatar has established an utterance system.

An utterance system exist whenever the avatar is in a conversation or has mutual attention and talking with his target getting enough replies.

Returns: bool
True if the avatar is part of a utterance system; false otherwise.

Attention: This is a very much experimental way of dealing with an utterance system. Also the terminology here is improper. Infact we don't much than just counting replies between two speaking avatars. There is much more than a number of replies behind the term utterance system.

setTTMind(self, new_mind)

 

Set a turn taking mind for the avatar.

Parameters:
  • new_mind (CDMMing.system.Engine) - An engine who simulates turn taking.

getConversationPrivacy(self)

 

Return to a CADIAPopulus editor the avatar conversation's privacy level.

Returns: float or None
The privacy level of the avatar's conversation; None if the avatar is not in a conversation.

setConversationPrivacy(self, prv)

 

Set from a CADIAPopulus editor the avatar conversation's privacy level.

Parameters:
  • prv (float) - A privacy value.

getPersonalDistance(self)

 

Return to a CADIAPopulus editor the avatar's personal distance.

Returns: float
The avatar's personal distance in meters.

setPersonalDistance(self, dist)

 

Set from a CADIAPopulus editor the avatar's personal distance.

Parameters:
  • prv - A distance in meters.
  • dist (float)

getPersonalDistanceWeight(self)

 

Return to a CADIAPopulus editor the weight of the KeepPersonalDistance reactive behavior.

Returns: float
The behavior weight.

setPersonalDistanceWeight(self, w)

 

Set from a CADIAPopulus editor the weight of the KeepPersonalDistance reactive behavior.

Parameters:
  • w (float) - A new weight.

getEqualityWeight(self)

 

Return to a CADIAPopulus editor the weight of the KeepConversationalEquality reactive behavior.

Returns: float
The behavior weight.

setEqualityWeight(self, w)

 

Set from a CADIAPopulus editor the weight of the KeepConversationalEquality reactive behavior.

Parameters:
  • w (float) - A new weight.

getCohesionWeight(self)

 

Return to a CADIAPopulus editor the weight of the KeepConversationalCohesion reactive behavior.

Returns: float
The behavior weight.

setCohesionWeight(self, w)

 

Set from a CADIAPopulus editor the weight of the KeepConversationalCohesion reactive behavior.

Parameters:
  • w (float) - A new weight.

getTestWeight(self)

 

Return to a CADIAPopulus editor the weight of the Test2Conversational reactive behavior.

Returns: float
The behavior weight.

setTestWeight(self, w)

 

Set from a CADIAPopulus editor the weight of the Test2Conversational reactive behavior.

Parameters:
  • w (float) - A new weight.

getTest2Weight(self)

 

Return to a CADIAPopulus editor the weight of the Test2Conversational reactive behavior.

Returns: float
The behavior weight.

Attention: ?? What the difference with Avatar.setTestWeight?

setTest2Weight(self, w)

 

Set from a CADIAPopulus editor the weight of the Test2Conversational reactive behavior.

Parameters:
  • w (float) - A new weight.

Attention: ?? What the difference with Avatar.setTestWeight?

getObstacleAvoidanceSafeRadius(self)

 

Return to a CADIAPopulus editor the safe radius of the ObstaclesAvoidance reactive behavior.

Returns: float
The safe radius.

setObstacleAvoidanceSafeRadius(self, r)

 

Set from a CADIAPopulus editor the safe raidus of the ObstaclesAvoidance reactive behavior.

Parameters:
  • r (float) - A new safe radius.

setDestination(self, point)

 

Call this method whenever the user wants to move his avatar to a given destination point.

Parameters:
  • point (Point3) - A point in global coordinates.

setInteraction(self, other)

 

Call this method whenever the user wants to interact with another Avatar.

Parameters:
  • other (Avatar) - The other avatar to interact with.

setText(self, sentence)

 

Call this method whenever the user typed some text and wants his avatar to say something.

Parameters:
  • sentence (string) - A sentence typed by the user.

say(self, text, stop=None)

 

The avatar sais something to his target.

The sentence will address the target as the intended listener.

Parameters:
  • text (string) - The sentence.
  • stop (bool) - undocumented

addressedBy(self, other, text)

 

Address the avatar with a given sentence.

Parameters:
  • other (Avatar) - The avatar who addresses.
  • text (string) - The sentence.

checkForReply(self, task)

 

Check how many replies the avatar have got during an exchanging of utterances with another avatar.

Parameters:
  • task (Task) - The Panda3D task who calls this method.

Note: This is a callback for a Panda3D task.

closeUtteranceSystem(self)

 

Close the avatar utterance system by setting the number replies to zero.

Attention: Absolutely experimental!!

initiateConversation(self, guest)

 

Initiate a conversation with another guest avatar.

This method will start a dyadic (two people) conversation with another avatar.

Parameters:
  • guest (Avatar) - The second participant in the conversation.

inviteToConversation(self, conversation)

 

Invite the avatar to join a given ongoing conversation.

Parameters:

Attention: Here the avatar should reason about to join or not to join. At the moment it wants always to join.

joinConversation(self, conversation)

 

Directly join the avatar to an ongoing conversation.

Parameters:

To Do: Review it! This method is odd.

setPropAsTarget(self, prop, engine)

 

Undocumented...

Parameters:
  • prop (guess a Prop.) - no idea.
  • engine (guess a MainEngine) - a mistery

purchaseAtCounter(self, counter)

 

Undocumented...

Parameters:
  • counter (guess a Prop.) - no idea.

purchaseAtCounterWith(self, counter, companyList)

 

Undocumented...

Parameters:
  • counter (guess a Prop.) - no idea.
  • companyList (guess a list.) - don't know.

joinQueue(self, qqueue)

 

Start MoveToQueue behavior.

Parameters:
  • qqueue (possibly a Queue) - no idea.

leaveQueue(self, queue)

 

Go to some spot away from the queue, fixed for now.

Parameters:
  • queue (possibly a Queue) - no idea.

To Do: Make it relative to the Prop, depending on a prob attrib.

fakeConversation(self, task)

 

Utter 'blah' continuously, just for debugging.

Parameters:
  • task (Task) - The Panda3D task who calls this method.

Note: This is a callback for a Panda3D task.

blink(self, manualBlink=None, blinkCount=0)

 

The avatar's blinking behaviour is set.

Setting manualBlink to false and blinkCount to 0 turns off blinking, if the blinkCount is 1 then the avatar will blink once.

Parameters:
  • manualBlink (bool) - Set whether blinking is manually controlled or not.
  • blinkCount (int) - Number of times the avatar blinks when set in manual mode

inspect(self, inspection=True)

 

Render the avatar's model in wireframe and shows his internal motion model.

If inspection is false then revert the operation.

Parameters:
  • inspection (bool) - If true inspect the avatar; if false revert inspection.

update(self, dt)

 

Call this to update the avatar's state.

Parameters:
  • dt (float) - Delta time since the simulation step.
Overrides: MotionModel.SimpleHumanBody.update

updateWhenRemote(self, dt)

 

Use this instead of Avatar.update when the avatar is remotely controlled.

Parameters:
  • dt (float) - Delta time since the simulation step.

Class Variable Details

MODEL_SCALE_FACTOR

An empirical scaling factor that depends from the size of the model. Changing model may require a different scaling factor.
Type:
float
Value:
0.00538889

ANIM_WALKING_PATH

Avatar walking animation's path.
Type:
string
Value:
'Models/Humanoid/LowPolyEgg/Humanoid_walking.egg'

ANIM_STEPLEFT_PATH

Avatar step left animation's path.
Type:
string
Value:
'Models/Humanoid/LowPolyEgg/Humanoid_step_left.egg'

ANIM_STEPRIGHT_PATH

Avatar step right animation's path.
Type:
string
Value:
'Models/Humanoid/LowPolyEgg/Humanoid_step_right.egg'

ANIM_STEPBACK_PATH

Avatar step back animation's path.
Type:
string
Value:
'Models/Humanoid/LowPolyEgg/Humanoid_backStep.egg'

ANIM_WANTSPEAK_PATH

Avatar want-to-speak animation's path.
Type:
string
Value:
'Models/Humanoid/LowPolyEgg/Humanoid_iWantToSpeak.egg'

ANIM_SPEAKING_PATH

Avatar speaking animation's path.
Type:
string
Value:
'Models/Humanoid/LowPolyEgg/Humanoid_speaking.egg'

ANIM_OPENMOUTH_PATH

Avatar open mouth animation's path.
Type:
string
Value:
'Models/Humanoid/LowPolyEgg/Humanoid_open_mouth.egg'