本文整理汇总了Java中com.threed.jpct.World类的典型用法代码示例。如果您正苦于以下问题:Java World类的具体用法?Java World怎么用?Java World使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
World类属于com.threed.jpct包,在下文中一共展示了World类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: JPCTBlendScene
import com.threed.jpct.World; //导入依赖的package包/类
/**
* JPCTScene constructor, loads an scene based on the main xml file
* (exported by blender)
*
* @param sceneFilename
* scene xml filename
*/
public JPCTBlendScene(String sceneFilename, World world) {
this.world = world;
File file = new File(sceneFilename);
sceneBasePath = file.getParentFile().getAbsolutePath() + File.separator;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder;
Document doc = null;
try {
builder = factory.newDocumentBuilder();
doc = builder.parse(sceneFilename);
parseRoot(doc.getFirstChild());
} catch (ParserConfigurationException | SAXException | IOException e) {
e.printStackTrace();
}
addSceneToWorld();
}
开发者ID:andresjesse,项目名称:jpctblend,代码行数:32,代码来源:JPCTBlendScene.java
示例2: addToWorld
import com.threed.jpct.World; //导入依赖的package包/类
/**
* Add the object to the world, including all the children
* @param world
*/
public void addToWorld(World world) {
world.addObject(this);
for (int i=0; i<mChildren.size(); i++) {
world.addObject(mChildren.get(i));
}
for (int i=0; i<mLights.size(); i++) {
mLights.get(i).addToWorld(world);
}
}
开发者ID:plattysoft,项目名称:ArToolKitJpctBaseLib,代码行数:14,代码来源:TrackableObject3d.java
示例3: configureARScene
import com.threed.jpct.World; //导入依赖的package包/类
/**
* Configuration of the AR Scene
* Initializes jPCT and gets the trackable objects list
* Registers the markers and adds the objects to the world
*/
@Override
public boolean configureARScene() {
// Initialize the game world and the camera
mWorld = new World();
mCamera = mWorld.getCamera();
// Set the FOV based on the camera parameters
// This FOW is correct when using
android.hardware.Camera.Parameters params = mActivity.getCameraPreview().getCameraParameters();
// Setting the FOV based on the camera params, this seems to work fine with 640x480
float fov = params.getHorizontalViewAngle();
float yfov = params.getVerticalViewAngle();
mCamera.setFOV(mCamera.convertDEGAngleIntoFOV(fov));
mCamera.setYFOV(mCamera.convertDEGAngleIntoFOV(yfov));
mActivity.configureWorld(mWorld);
// Get the activity list of trackable objects
mTrackableObjects = mActivity.getTrackableObject3DList();
// Load all the markers and add the objects to the world
for (int i=0; i<mTrackableObjects.size(); i++) {
TrackableObject3d trackableObject = mTrackableObjects.get(i);
// Load the marker
if (! trackableObject.registerMarker() ) {
// If there was a problem, return false
return false;
}
// Add the object to the world, note that mWorld.addObject is not recursive
trackableObject.addToWorld(mWorld);
}
mWorld.buildAllObjects();
mFovSet = false;
return true;
}
开发者ID:plattysoft,项目名称:ArToolKitJpctBaseLib,代码行数:43,代码来源:ArJcptRenderer.java
示例4: JpctMesh
import com.threed.jpct.World; //导入依赖的package包/类
public JpctMesh(World world, JpctTexture texture)
{
this.world = world;
verts = new ArrayList<Vector3f>();
colours = new ArrayList<Vector4f>();
texCoords = new ArrayList<Vector2f>();
object3D = new Object3D(1024);
// obj.setBaseTexture("box");
object3D.setCulling(false);
}
开发者ID:tectonicus,项目名称:tectonicus,代码行数:14,代码来源:JpctMesh.java
示例5: addToWorld
import com.threed.jpct.World; //导入依赖的package包/类
/**
* Create here your logic to add your actor to the world.
*
* @param world
* World to add the actor
*/
@Override
public void addToWorld(World world) {
this.world = world;
world.addObject(obj);
}
开发者ID:andresjesse,项目名称:jpctblend,代码行数:13,代码来源:SampleActor.java
示例6: setupEngine
import com.threed.jpct.World; //导入依赖的package包/类
/**
* Setup the engine. Create the world.
*/
private void setupEngine() {
fb = new FrameBuffer(1024, 768, FrameBuffer.SAMPLINGMODE_NORMAL);
fb.disableRenderer(IRenderer.RENDERER_SOFTWARE);
fb.enableRenderer(IRenderer.RENDERER_OPENGL);
world = new World();
}
开发者ID:andresjesse,项目名称:jpctblend,代码行数:11,代码来源:Gameplay.java
示例7: configureWorld
import com.threed.jpct.World; //导入依赖的package包/类
public void configureWorld(World world) {
world.setAmbientLight(150, 150, 150);
}
开发者ID:plattysoft,项目名称:ArToolKitJpctBaseLib,代码行数:4,代码来源:ARSimple.java
示例8: addToWorld
import com.threed.jpct.World; //导入依赖的package包/类
public void addToWorld(World world) {
mLight = new Light(world);
setPosition(mPosition);
setIntensity(mR, mG, mB);
setVisibility(mVisible);
}
开发者ID:plattysoft,项目名称:ArToolKitJpctBaseLib,代码行数:7,代码来源:TrackableLight.java
示例9: configureWorld
import com.threed.jpct.World; //导入依赖的package包/类
public void configureWorld(World world) {
Config.farPlane = 2000;
world.setAmbientLight(255, 255, 255);
}
开发者ID:plattysoft,项目名称:ArToolKitJpctBaseLib,代码行数:5,代码来源:MainActivity.java
示例10: drawScene
import com.threed.jpct.World; //导入依赖的package包/类
private void drawScene(){
world = new World();
Vector<EditorObject> objects = new Vector<EditorObject>();
Vector<LightData> lights = new Vector<LightData>();
String flagModeSetting = prefs.getString(Settings.FLAG_MODE_SETTING, Settings.FLAG_MODE_FULLSCREEN);
String flagSpeedSetting = prefs.getString(Settings.FLAG_SPEED, "normal");
AssetManager assetManager = FlagWallpaperService.context.getAssets();
objects = Scene.loadSerializedLevel(flagModeSetting+"_"+flagSpeedSetting+".txt", objects, lights, null,null, world, assetManager);
flag = (Scene.findObject(flagModeSetting+"0", objects));
Animator.Play(flag, "wave", objects);
float[] bb = flag.getMesh().getBoundingBox();
float width = Math.abs(bb[0]-bb[1]);
Camera cam = world.getCamera();
float moveout;
if(flagModeSetting.equals(Settings.FLAG_MODE_FULLSCREEN)){
pole = null;
moveout = 30;
cam.setPositionToCenter(flag);
cam.moveCamera(Camera.CAMERA_MOVEOUT, moveout);
// cam.setYFOV(cam.convertRADAngleIntoFOV((float) Math.atan(height/(2*moveout))));
cam.setFOV(cam.convertRADAngleIntoFOV((float) Math.atan(width/(2*moveout))));
cam.lookAt(flag.getTransformedCenter());
}else{
pole = (Scene.findObject("pole", objects));
float height = Math.abs(bb[2]-bb[3]);
moveout = 35;
cam.setPosition(0, 0, 0);
cam.moveCamera(Camera.CAMERA_MOVEOUT, moveout);
cam.moveCamera(Camera.CAMERA_MOVEDOWN, height-5);
cam.setFOV(cam.convertRADAngleIntoFOV((float) Math.atan(width/(2*moveout))));
cam.lookAt(new SimpleVector(width/2, -height/2, 0));
}
Light sun = new Light(world);
SimpleVector sv = new SimpleVector();
sv.set(flag.getTransformedCenter());
sv.y += 100;
sv.x -= 100;
sv.z -= 30;
sun.setPosition(sv);
// sun.disable();
MemoryHelper.compact();
}
开发者ID:danilox6,项目名称:flag3dlivewallpaperbase,代码行数:52,代码来源:FlagRenderer.java
示例11: getWorld
import com.threed.jpct.World; //导入依赖的package包/类
/**
* Get the world instance used by the renderer.
* May be null if configureARScene has not yet been called.
* @return the world instance used by the renderer.
*/
public World getWorld() {
return mWorld;
}
开发者ID:plattysoft,项目名称:ArToolKitJpctBaseLib,代码行数:9,代码来源:ArJcptRenderer.java
示例12: configureWorld
import com.threed.jpct.World; //导入依赖的package包/类
/**
* Override this method to add extra configuration to the world such as ambient light, etc
* @param world
*/
public abstract void configureWorld(World world);
开发者ID:plattysoft,项目名称:ArToolKitJpctBaseLib,代码行数:6,代码来源:ArJpctActivity.java
示例13: addToWorld
import com.threed.jpct.World; //导入依赖的package包/类
/**
* Create here your logic to add your actor to the world.
*
* @param world
* World to add the actor
*/
public void addToWorld(World world);
开发者ID:andresjesse,项目名称:jpctblend,代码行数:8,代码来源:IActor.java
注:本文中的com.threed.jpct.World类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论