本文整理汇总了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();
}
示例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);
}
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
示例7: configureWorld
import com.threed.jpct.World; //导入依赖的package包/类
public void configureWorld(World world) {
world.setAmbientLight(150, 150, 150);
}
示例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);
}
示例9: configureWorld
import com.threed.jpct.World; //导入依赖的package包/类
public void configureWorld(World world) {
Config.farPlane = 2000;
world.setAmbientLight(255, 255, 255);
}
示例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();
}
示例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;
}
示例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);
示例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);