![]() |
|
#1
|
|||
|
|||
Hi,
The punching demo is available for download at the following link:http://www.worldviz.com/download/index.php?id=19 The actiondata is just a generic container which holds the data describing an action. It must contain an attribute called actionclass which points to an ActionInstance class that implements the action. The fall action in the punching demo is a good example of how to implement your own action class. To get the current action of a node use: Code:
node.get(viz.CURRENT_ACTION) |
#2
|
|||
|
|||
Still Confused
I'm still really confused on what the purpose of the FallAction class is. Would it be possible to give a brief synopsis of what it entails. Specifically, I'd like to know what the following lines do. Thanks,
Code:
fall = viz.ActionData() fall.data = [5,5,5] fall.actionclass = FallAction Code:
def begin(self,object): self.distance = self._actiondata_.data[0] self.speed = self._actiondata_.data[1] self.anim = self._actiondata_.data[2] self.amount = 0 object.state(1) object.clear(1,0) object.execute(self.anim) yaw = object.get(viz.EULER)[0] self.vector = [-math.sin(yaw*vizmat.DEG_TO_RAD),0,-math.cos(yaw*vizmat.DEG_TO_RAD)] self.pos = object.get(viz.POSITION) Last edited by betancourtb82; 03-02-2006 at 12:42 PM. |
#3
|
|||
|
|||
Hi,
The first code block create an ActionData object. An ActionData object simply holds the relevant information for performing an action. You can put whatever information you want inside of it. The actionclass member is the only attribute of the ActionData object that must be defined. It needs to point to a class that inherits from viz.ActionClass. The _actiondata_ member of the ActionClass is a reference to the ActionData object. So in the code you provided, it is simply retrieving the 3 values from the ActionData object. In that specific example, the 3 values are the distance to fall, the speed to fall, and the animation to play. |
#4
|
|||
|
|||
Another Question
I had a question about the Punching Demo Prompt. Everything works out fine when I run it checking off "HMD", "Stereo", and "FullScreen". The problem occurs when I click on Tracker. Should this demo be able to look around as I'm punching? I removed the viz.eyeheight(-0.3) command and that corrects the height of the viewpoint, but once I turn on the tracker, the fist does not work. Any suggestions?
|
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|