本文整理汇总了C++中RefVec3类的典型用法代码示例。如果您正苦于以下问题:C++ RefVec3类的具体用法?C++ RefVec3怎么用?C++ RefVec3使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RefVec3类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Java_org_openscenegraph_osg_core_Vec3_nativeNormalize
JNIEXPORT jfloat JNICALL Java_org_openscenegraph_osg_core_Vec3_nativeNormalize(JNIEnv *, jclass, jlong cptr)
{
RefVec3 *v = reinterpret_cast<RefVec3 *>(cptr);
if(v != 0)
{
return v->normalize();
}
return 0;
}
示例2: Java_org_openscenegraph_osg_core_Vec3_nativeSetZ
JNIEXPORT void JNICALL Java_org_openscenegraph_osg_core_Vec3_nativeSetZ(JNIEnv *, jclass, jlong cptr,
jfloat value)
{
RefVec3 *v = reinterpret_cast<RefVec3 *>(cptr);
if(v != 0)
{
v->z() = value;
}
}
示例3: Java_org_openscenegraph_osg_core_Vec3_nativeSet
JNIEXPORT void JNICALL Java_org_openscenegraph_osg_core_Vec3_nativeSet(JNIEnv *, jclass, jlong cptr,
jfloat x, jfloat y, jfloat z)
{
RefVec3 *v = reinterpret_cast<RefVec3 *>(cptr);
if(v != 0)
{
v->set(x,y,z);
}
}
示例4: Java_org_openscenegraph_osg_core_AnimationPathCallback_nativeGetPivotPoint
JNIEXPORT jlong JNICALL Java_org_openscenegraph_osg_core_AnimationPathCallback_nativeGetPivotPoint(JNIEnv *, jclass, jlong cptr)
{
osg::AnimationPathCallback *cb = reinterpret_cast<osg::AnimationPathCallback *>(cptr);
if(cb != 0)
{
osg::Vec3 ret = cb->getPivotPoint();
RefVec3 *refRet = new RefVec3();
refRet->set(ret.x(),ret.y(),ret.z());
refRet->ref();
return reinterpret_cast<jlong>(refRet);
}
return 0L;
}
示例5: Java_org_openscenegraph_osg_core_Vec3_nativeNegation
JNIEXPORT jfloat JNICALL Java_org_openscenegraph_osg_core_Vec3_nativeNegation(JNIEnv *, jclass, jlong cptr)
{
RefVec3 *v = reinterpret_cast<RefVec3 *>(cptr);
if(v != 0)
{
osg::Vec3 res = -(*v);
RefVec3 *refRes = new RefVec3();
refRes->set(res);
refRes->ref();
return reinterpret_cast<jlong>(refRes);
}
return 0l;
}
示例6: Java_org_openscenegraph_osg_core_Vec3_nativeEscalarProduct
JNIEXPORT jlong JNICALL Java_org_openscenegraph_osg_core_Vec3_nativeEscalarProduct(JNIEnv *, jclass, jlong cptr,
jfloat value)
{
RefVec3 *v = reinterpret_cast<RefVec3 *>(cptr);
if(v != 0)
{
osg::Vec3 res = (*v)*value;
RefVec3 *refRes = new RefVec3();
refRes->set(res);
refRes->ref();
return reinterpret_cast<jlong>(refRes);
}
return 0l;
}
示例7: Java_org_openscenegraph_osg_core_Vec3_nativeSub
JNIEXPORT jlong JNICALL Java_org_openscenegraph_osg_core_Vec3_nativeSub(JNIEnv *, jclass, jlong cptr,
jlong lrhs)
{
RefVec3 *v = reinterpret_cast<RefVec3 *>(cptr);
RefVec3 *rhs = reinterpret_cast<RefVec3 *>(lrhs);
if(v != 0 && rhs !=0)
{
osg::Vec3 res = (*v)-(*rhs);
RefVec3 *refRes = new RefVec3();
refRes->set(res);
refRes->ref();
return reinterpret_cast<jlong>(refRes);
}
return 0l;
}
示例8: Java_org_openscenegraph_osg_viewer_OffScreenViewer_nativeRaycast
JNICALL jlong JNICALL Java_org_openscenegraph_osg_viewer_OffScreenViewer_nativeRaycast(JNIEnv* env, jclass, jlong viewer_cptr, jlong camera_ptr, jlong vec2array_cptr)
{
osg::Vec3Array* v3a = new osg::Vec3Array();
v3a->ref();
osgViewer::View* viewer = reinterpret_cast<osgViewer::View*>(viewer_cptr);
osg::Camera* cam = reinterpret_cast<osg::Camera*>(camera_ptr);
osg::Vec2Array* va = reinterpret_cast<osg::Vec2Array*>(vec2array_cptr);
osgUtil::LineSegmentIntersector::Intersections intersections;
for(uint i = 0; i < va->size(); i++)
{
if(i==0)
{
osg::Matrixf cmat = cam->getViewMatrix();
float* data = (float*)(cmat.ptr());
LOGI("[%f,%f,%f,%f]",data[0],data[1],data[2],data[3]);
LOGI("[%f,%f,%f,%f]",data[4],data[5],data[6],data[7]);
LOGI("[%f,%f,%f,%f]",data[8],data[9],data[10],data[11]);
LOGI("[%f,%f,%f,%f]",data[12],data[13],data[14],data[15]);
osg::Vec3 eye, center, up;
cam->getViewMatrixAsLookAt(eye,center,up);
LOGI("Eye: (%f,%f,%f) - Center: (%f,%f,%f) - Up: (%f,%f,%f)",eye.x(), eye.y(), eye.z(), center.x(), center.y(), center.z(), up.x(), up.y(), up.z());
}
viewer->computeIntersections(const_cast<const osg::Camera*>(cam), osgUtil::Intersector::WINDOW, va->at(i).x(), va->at(i).y(), intersections);
RefVec3 *refRes = new RefVec3();
if(intersections.empty() == false)
{
refRes->set(intersections.begin()->getWorldIntersectPoint().x(), intersections.begin()->getWorldIntersectPoint().y(), intersections.begin()->getWorldIntersectPoint().z());
}
else
{
refRes->set(DBL_MAX,DBL_MAX,DBL_MAX);
}
refRes->ref();
v3a->push_back(*refRes);
}
return reinterpret_cast<jlong>(v3a);
}
示例9: Java_org_openscenegraph_osg_core_Vec3_nativeCreateVec3
JNIEXPORT jlong JNICALL Java_org_openscenegraph_osg_core_Vec3_nativeCreateVec3(JNIEnv *, jclass)
{
RefVec3 *v = new RefVec3();
v->ref();
return reinterpret_cast<jlong>(v);
}
示例10: Java_org_openscenegraph_osg_core_Vec3_nativeDispose
/**
* osg::Vec3
*/
JNIEXPORT void JNICALL Java_org_openscenegraph_osg_core_Vec3_nativeDispose(JNIEnv *, jclass, jlong cptr)
{
RefVec3 *v = reinterpret_cast<RefVec3 *>(cptr);
if(v != 0)
v->unref();
}