KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > buchuki > ensmer > input > event > semantic > UserMoveEvent


1 /*
2  * Copyright 2004 Dusty Phillips
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package com.buchuki.ensmer.input.event.semantic;
18
19 import java.util.EventObject JavaDoc;
20 import javax.vecmath.Matrix4f;
21
22 /**
23  * Event fired when the user position is moved.
24  *
25  * @author Dusty Phillips [dusty@buchuki.com]
26  */

27 public class UserMoveEvent extends EventObject JavaDoc {
28     
29     /**
30      * Creates a new instance of UserMoveEvent
31      *
32      * @param source the object firing the event
33      * @param motion the Matrix representing a primitive movement. This matrix
34      * will contain either a rotation about one of the axes, or a translation in
35      * one of the axes, not a combination.
36      * This is done so that listening classes can determine which kind of primitive
37      * movement actually ocurred; they may be combined for efficiency later on in
38      * the processing, but this will be transparent to listening classes.
39      *
40      * Later this class may contain utility methods to determine which sort
41      * of primitive motion occured.
42      */

43     public UserMoveEvent(Object JavaDoc source, Matrix4f motion) {
44         super(source);
45         this.motion = motion;
46     }
47     
48     /**
49      * Get the motion associated with this event. This motion is relative to a
50      * user's current position, and is guaranteed to be a primitive rotation or
51      * translation.
52      *
53      * @return the motion associated with this event
54      */

55     public Matrix4f getMotion() {
56         return motion;
57     }
58     
59     /**
60      * The motion associated with this event
61      */

62     private Matrix4f motion;
63 }
64
Popular Tags