0. Introduction In our CVE Unicron avatars are robust enough to interact with other humanoid avatars driven by users from everywhere. However, in reality the environment and avatars are not the only components, as it introduce many types of objects that can be interacted with humanoid avatars and also with each other. Introducing such object to Unicron is the topic of this online documentation. Currently, we are implementing dynamic objects from scratch. From the design phase we hope to come up with a simple but robust way to passing objects among avatars and the environment. 1. Design The following takes place during a life time of Unicron regarding graphic rendering. For this simplified description uses World as the unicron environment, and an object, pen, is used to denote an object. World.render() # the environment is rendered Pen.render() # the object, pen, is rendered Avatar.render() # the avatar is rendered 1.1. Retrieving/Storing Objects First thing is first. We must be able to come up with a way to store away information on each object appeared in Unicron. One way can be implemented just as how Rooms are constructed from scratch at the startup of Unicron by utilizing a file model.dat. When World is rendered, it reads in an object.dat file that contains information of each object placed in World. The information include object's physical location (in xyz coordinates), color, movability, ownership and so on. The probable format of object.dat file would look similar to that of model.dat. 2. Avatar APIs APIs provided by the avatar for object interactions are given here. sitDown(Obj) The method sitdown(Obj), when called, has Avarcron sit down on an object, Obj. The input, Obj, is a sittable object such as chair, couch, and possibly desk (for professors). Avarcron first bends the knees and then placed on the object. The object being passed should follow an object guideline of Unicron. That is, the object should have APIs for returning its desired sitting x-y-z position and the sitting angle for Avarcron. This method does not return anything. standUp() When this method is called, it is expected that the avatar is sat down already. If it is not, the method does nothing and returns. When it is sat down, it stands up to the original position to the angle where it was pointing prior to sittin down. This method does not return anything. possess(Obj) The method possess(Obj) has Avarcon picks up an object, Obj, on its hand. When Obj is picked up by Avarcron, it is put into a list, which contains all the objects being held by Avarcron. Only one object can be visible at time, others being kept invisibly. unpossess(Obj) The method unpossess(Obj) deletes the object, Obj, from the object list, thus, it no longer holds the object. 3. Object APIs 1: PushMatrix() 2: sca:=Scale(1,1,1) 3: Translate(x,y,z) 4: rot:=Rotate(0,0,1,0) 5: PushMatrix() 6: mv:=Translate(0,0,0) 7: romx:=Rotate(0,1,0,0) 8: romy:=Rotate(0,0,1,0) 9: romz:=Rotate(0,0,0,1) 10: PushMatrix() 11: mvDraw:=Translate(0,0,0) 12: rox:=Rotate(origXangle,1,0,0) 13: roy:=Rotate(origYangle,0,1,0) 14: roz:=Rotate(origZangle,0,0,1) 15: PopMatrix() 16: PopMatrix() 17: PopMatrix() The methods useful for Dynamic Object Implemntation for objects are kept in class called ToolsUtilities. It contains the API for objects to interact with an avatar. The following are the methods of API. We can divide the API into two parts. One part of the API contains the methods which are useful in setting the position of the object w.r.t. the avatar,arm when he possesses an object in CVE. The second part conatins the methods useful to keep the object in avatar's hand while he moves in CVE. Along with these methods we also have some other methods which returns values useful for avatar. The following three methods belongs to the first part of API, setSize(xscale,yscale,zscale) This method takes the scaling factors from the avatar to scaleup or scaledown the object size held by avatar according to his size. By using this method we can implement objects of various sizes based on avatar's size. setPosAvatar(posx,posy,posz) This method useful for placing the object position w.r.t. position of the avatar. As avatar moves in CVE we will call this method to set the object's position as that of avatar. This method effects the 2-4 lines in the above code. setPosPart(posx,posy,posz) This method useful for setting the position of the object to the position of the left arm. Whenever the avatar possesses an object in CVE the possess method in 'arm' class calls this method to set the object position and orientation as that of the part(arm here) which holds the object. This method effects the 6-9 lines in the above code. setPosObj(posx,posy,posz) This method useful for setting the position of the object w.r.t. position of the left arm. Whenever the avatar possesses an object in CVE the possess method in 'arm' class calls this method to set the object position and orientation of the object w.r.t. left arm, which holds the object. This method effects the 11-14 lines in the above code. The following three methods belongs to the second part of API, moveAlongAvatar(posx,posy,posz,angle) This method useful in changing the position and orientation of the object held by an avatar while he moves and rotates in CVE. We will call this method whenever the avatar moves , turns in CVE. moveAlongPart(xnagle,yangle,zangle) This method useful in changing the orentation of the object when avatar's hand rotates in CVE like moving the object front and back whenever the avatar's hands moves front and back while he is moving. unpossessed(posx,posy,posz) This method unpossesses the object from avatar's hands by setting the various variables. It mainly sets the position of the object to the position of the avatar but having the 'y' coordinate to '0' to place it one the floor. getX(): getY(): getZ(): These methods returns the current 'x','y','z' coordiantes of the object. These methods are useful in sitDown, standUp methods in avatar. Dynamic Object Implementation APIs
Yosep Kim and Shyam Bukka June 2nd, 2005