bone.java

来自「赫赫大名的 OGRE 游戏引擎」· Java 代码 · 共 109 行

JAVA
109
字号
/*  Ogre4J
    Copyright (C) 2002 macross

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
package org.ogre4j;

import org.ogre4j.math.Quaternion;
import org.ogre4j.math.Vector3;

/**
 * Bone
 * 
 * @author Ivica Aracic <ivica.aracic@bytelords.de>
 */
public class Bone extends NativeObject implements Node {
    
    // TODO 1) create Bone children
    //public native Bone createChild(int handle);
    
    public native int getHandle();
    
    public native void setManuallyControlled(boolean manuallyControlled);
    
    public native boolean isManuallyControlled();
    
    /*
     * Implemented from Node 
     */
     
    public native String getName();

    public native Node getParent();

    public native Quaternion getOrientation();

    public native void setOrientation(Quaternion q);

    public native void setOrientation(float w, float x, float y, float z);

    public native void resetOrientation();

    public native void setPosition(Vector3 pos);

    public native void setPosition(float x, float y, float z);

    public native Vector3 getPosition(); 

    public native void  setScale(Vector3 scale);

    public native void  setScale(float x, float y, float z);

    public native Vector3 getScale();

    public native void setInheritScale(boolean inherit);

    public native boolean getInheritScale();

    public native void scale(Vector3 scale);

    public native void scale(float x, float y, float z);

    public native void translate(Vector3 d);
    
    public native void moveRelative(Vector3 d);

    public native void translate (float x, float y, float z);

    public native void roll (float degrees);
    
    public native void yaw(float degrees);

    public native void pitch(float degrees);

    public native void rotate(Vector3 axis, float degrees);

    public native void  rotate(Quaternion q);

    public native void addChild(Node child);

    public native int numChildren();

    public native Node getChild(int index);
    public native Node getChild(String name);

    public native Node removeChild(int index);
    public native Node removeChild(String name);
    public native void removeAllChildren();

    public native Quaternion getDerivedOrientation();
    public native Vector3 getDerivedPosition();
    public native Vector3 getDerivedScale();

    // delegated to Matrix3
    public native Vector3 getLocalAxis(int axis);    
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?