⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scenenode.java

📁 使用stl技术,(还没看,是听说的)
💻 JAVA
字号:
/*  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;

/**
 * SceneNode
 * 
 * TODO: do we need matrix methods?
 * TODO 1) methods returning MoveableObject, great problem again :(
 *         solution: change return value to void
 *         can obtain concrete objects from SceneManager
 * @author Ivica Aracic <ivica.aracic@bytelords.de>
 */
public class SceneNode extends NativeObject implements Node {
    
    public native void attachObject(MovableObject object);
    
    public native int numAttachedObjects();

/*    
    public native MovableObject getAttachedObject(int index);

    public native MovableObject getAttachedObject(String name);
*/
    public native void detachObject(int index);

    public native void detachObject(String name);

    public native void detachAllObjects();

    public native void attachLight(Light l);

    public native void attachCamera(Camera cam);

    public native SceneManager getCreator();

    public native void removeAndDestroyChild(String name);

    public native void removeAndDestroyChild(int index);

    public native void removeAndDestroyAllChildren();

    public native void showBoundingBox(boolean show);
    
    public native SceneNode createChild();     
    
    public native SceneNode createChild(String name);
    
    
    /*
     * 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -