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

📄 org_ogre4j_camera.cpp

📁 使用stl技术,(还没看,是听说的)
💻 CPP
字号:
/*  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
*/
#include "org_ogre4j_Camera.h"

#include "Ogre4JRoot.h"

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Camera_setDetailLevel
(JNIEnv *, jobject obj, jint detailLevel) {
    Camera* cam = (Camera*)OGRE4J.getCppRef(obj);
    cam->setDetailLevel((SceneDetailLevel)detailLevel);
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jint JNICALL Java_org_ogre4j_Camera_getDetailLevel
(JNIEnv *, jobject obj) {
    Camera* cam = (Camera*)OGRE4J.getCppRef(obj);
    return (jint)cam->getDetailLevel();
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Camera_setPosition__FFF
(JNIEnv *, jobject obj, jfloat x, jfloat y, jfloat z) {
    Camera* cam = (Camera*)OGRE4J.getCppRef(obj);
    cam->setPosition(x,y,z);
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Camera_setPosition__Lorg_ogre4j_math_Vector3_2
(JNIEnv *, jobject obj, jobject vec) {
    Camera* cam = (Camera*)OGRE4J.getCppRef(obj);
    cam->setPosition(OGRE4J.newVector3(vec));
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jobject JNICALL Java_org_ogre4j_Camera_getPosition
(JNIEnv *, jobject obj) {
    Camera* cam = (Camera*)OGRE4J.getCppRef(obj);
    return OGRE4J.newVector3(cam->getPosition());
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Camera_lookAt
(JNIEnv *, jobject obj, jfloat x, jfloat y, jfloat z) {
    Camera* cam = (Camera*)OGRE4J.getCppRef(obj);
    cam->lookAt(x,y,z);
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jstring JNICALL Java_org_ogre4j_Camera_getName
(JNIEnv *env, jobject obj) {
    Camera* o = (Camera*)OGRE4J.getCppRef(obj);
    return env->NewStringUTF(o->getName());
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Camera_setFarClipDistance
(JNIEnv *, jobject obj, jfloat d) {
    Camera* o = (Camera*)OGRE4J.getCppRef(obj);
    o->setFarClipDistance(d);
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jfloat JNICALL Java_org_ogre4j_Camera_getFarClipDistance
(JNIEnv *, jobject obj) {
    Camera* o = (Camera*)OGRE4J.getCppRef(obj);
    return o->getFarClipDistance();
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Camera_setNearClipDistance
(JNIEnv *, jobject obj, jfloat d) {
    Camera* o = (Camera*)OGRE4J.getCppRef(obj);
    o->setNearClipDistance(d);
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT jfloat JNICALL Java_org_ogre4j_Camera_getNearClipDistance
(JNIEnv *, jobject obj) {
    Camera* o = (Camera*)OGRE4J.getCppRef(obj);
    return o->getNearClipDistance();
}


//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Camera_setFOVy
(JNIEnv *, jobject obj, jfloat fov) {
    Camera* o = (Camera*)OGRE4J.getCppRef(obj);
    o->setFOVy(fov);
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Camera_moveRelative
(JNIEnv *, jobject obj, jobject vec) {
    Camera* o = (Camera*)OGRE4J.getCppRef(obj);
    o->moveRelative(OGRE4J.newVector3(vec));
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Camera_roll
(JNIEnv *, jobject obj, jfloat degree) {
    Camera* o = (Camera*)OGRE4J.getCppRef(obj);
    o->roll(degree);
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Camera_yaw
(JNIEnv *, jobject obj, jfloat degree) {
    Camera* o = (Camera*)OGRE4J.getCppRef(obj);
    o->yaw(degree);
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

JNIEXPORT void JNICALL Java_org_ogre4j_Camera_pitch
(JNIEnv *, jobject obj, jfloat degree) {
    Camera* o = (Camera*)OGRE4J.getCppRef(obj);
    o->pitch(degree);
}

//==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==~==

⌨️ 快捷键说明

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