本文整理汇总了Java中com.jme3.scene.shape.Box.scaleTextureCoordinates方法的典型用法代码示例。如果您正苦于以下问题:Java Box.scaleTextureCoordinates方法的具体用法?Java Box.scaleTextureCoordinates怎么用?Java Box.scaleTextureCoordinates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.scene.shape.Box
的用法示例。
在下文中一共展示了Box.scaleTextureCoordinates方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createWall
import com.jme3.scene.shape.Box; //导入方法依赖的package包/类
private void createWall() {
float xOff = -144;
float zOff = -40;
float startpt = bLength / 4 - xOff;
float height = 6.1f;
brick = new Box(Vector3f.ZERO, bLength, bHeight, bWidth);
brick.scaleTextureCoordinates(new Vector2f(1f, .5f));
for (int j = 0; j < 15; j++) {
for (int i = 0; i < 4; i++) {
Vector3f vt = new Vector3f(i * bLength * 2 + startpt, bHeight + height, zOff);
addBrick(vt);
}
startpt = -startpt;
height += 1.01f * bHeight;
}
}
示例2: setUpMap
import com.jme3.scene.shape.Box; //导入方法依赖的package包/类
private void setUpMap() {
Material floor_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
key3.setGenerateMips(true);
Texture tex3 = assetManager.loadTexture(key3);
tex3.setWrap(WrapMode.Repeat);
floor_mat.setTexture("ColorMap", tex3);
Box floor = new Box(MAP_WIDTH * PLACE_HOLDER, 1f, MAP_HEIGHT * PLACE_HOLDER);
floor.scaleTextureCoordinates(new Vector2f(MAP_HEIGHT, MAP_WIDTH));
floor_geo = new Geometry("Floor", floor);
floor_geo.setMaterial(floor_mat);
rootNode.attachChild(floor_geo);
/* Make the floor physical with mass 0.0f! */
RigidBodyControl floor_phy = new RigidBodyControl(0.0f);
floor_geo.addControl(floor_phy);
floor_phy.setPhysicsLocation(new Vector3f(0, -1f, 0));
floor_geo.getControl(RigidBodyControl.class).setFriction(.5f);
bullet.getPhysicsSpace().add(floor_geo);
}
示例3: setUpMap
import com.jme3.scene.shape.Box; //导入方法依赖的package包/类
private void setUpMap() {
Material floor_mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
TextureKey key3 = new TextureKey("Textures/ground.png");
key3.setGenerateMips(true);
Texture tex3 = assetManager.loadTexture(key3);
tex3.setWrap(WrapMode.Repeat);
floor_mat.setTexture("ColorMap", tex3);
Box floor = new Box(20f, 0.0f, 20f);
floor.scaleTextureCoordinates(new Vector2f(20, 20));
Geometry floor_geo = new Geometry("Floor", floor);
floor_geo.setMaterial(floor_mat);
pivot.attachChild(floor_geo);
/* Make the floor physical with mass 0.0f! */
RigidBodyControl floor_phy = new RigidBodyControl(0.0f);
floor_geo.addControl(floor_phy);
floor_phy.setPhysicsLocation(new Vector3f(0, 0, 0));
bullet.getPhysicsSpace().add(floor_geo);
}
示例4: setupFloor
import com.jme3.scene.shape.Box; //导入方法依赖的package包/类
public void setupFloor(){
Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m");
mat.getTextureParam("DiffuseMap").getTextureValue().setWrap(WrapMode.Repeat);
mat.getTextureParam("NormalMap").getTextureValue().setWrap(WrapMode.Repeat);
// mat.getTextureParam("ParallaxMap").getTextureValue().setWrap(WrapMode.Repeat);
mat.setFloat("Shininess",3);
// mat.setBoolean("VertexLighting", true);
Box floor = new Box(Vector3f.ZERO, 50, 1f, 50);
TangentBinormalGenerator.generate(floor);
floor.scaleTextureCoordinates(new Vector2f(5, 5));
Geometry floorGeom = new Geometry("Floor", floor);
floorGeom.setMaterial(mat);
floorGeom.setShadowMode(ShadowMode.Receive);
rootNode.attachChild(floorGeom);
}
示例5: setupFloor
import com.jme3.scene.shape.Box; //导入方法依赖的package包/类
public void setupFloor() {
Material mat = assetManager.loadMaterial("Textures/Terrain/BrickWall/BrickWall.j3m");
mat.getTextureParam("DiffuseMap").getTextureValue().setWrap(WrapMode.Repeat);
mat.getTextureParam("NormalMap").getTextureValue().setWrap(WrapMode.Repeat);
mat.getTextureParam("ParallaxMap").getTextureValue().setWrap(WrapMode.Repeat);
Box floor = new Box(Vector3f.ZERO, 50, 1f, 50);
TangentBinormalGenerator.generate(floor);
floor.scaleTextureCoordinates(new Vector2f(5, 5));
Geometry floorGeom = new Geometry("Floor", floor);
floorGeom.setMaterial(mat);
floorGeom.setShadowMode(ShadowMode.Receive);
rootNode.attachChild(floorGeom);
}
示例6: simpleInitApp
import com.jme3.scene.shape.Box; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
bulletAppState = new BulletAppState();
bulletAppState.setThreadingType(BulletAppState.ThreadingType.PARALLEL);
stateManager.attach(bulletAppState);
bullet = new Sphere(32, 32, 0.4f, true, false);
bullet.setTextureMode(TextureMode.Projected);
bulletCollisionShape = new SphereCollisionShape(0.4f);
brick = new Box(Vector3f.ZERO, bLength, bHeight, bWidth);
brick.scaleTextureCoordinates(new Vector2f(1f, .5f));
initMaterial();
initWall();
initFloor();
initCrossHairs();
this.cam.setLocation(new Vector3f(0, 6f, 6f));
cam.lookAt(Vector3f.ZERO, new Vector3f(0, 1, 0));
cam.setFrustumFar(15);
inputManager.addMapping("shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
inputManager.addListener(actionListener, "shoot");
inputManager.addMapping("gc", new KeyTrigger(KeyInput.KEY_X));
inputManager.addListener(actionListener, "gc");
rootNode.setShadowMode(ShadowMode.Off);
bsr = new BasicShadowRenderer(assetManager, 256);
bsr.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
viewPort.addProcessor(bsr);
}
示例7: initFloor
import com.jme3.scene.shape.Box; //导入方法依赖的package包/类
public void initFloor() {
Box floorBox = new Box(Vector3f.ZERO, 10f, 0.1f, 5f);
floorBox.scaleTextureCoordinates(new Vector2f(3, 6));
Geometry floor = new Geometry("floor", floorBox);
floor.setMaterial(mat3);
floor.setShadowMode(ShadowMode.Receive);
floor.setLocalTranslation(0, -0.1f, 0);
floor.addControl(new RigidBodyControl(new BoxCollisionShape(new Vector3f(10f, 0.1f, 5f)), 0));
this.rootNode.attachChild(floor);
this.getPhysicsSpace().add(floor);
}
示例8: simpleInitApp
import com.jme3.scene.shape.Box; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
bulletAppState = new BulletAppState();
bulletAppState.setThreadingType(BulletAppState.ThreadingType.PARALLEL);
stateManager.attach(bulletAppState);
bullet = new Sphere(32, 32, 0.4f, true, false);
bullet.setTextureMode(TextureMode.Projected);
bulletCollisionShape = new SphereCollisionShape(0.4f);
brick = new Box(Vector3f.ZERO, brickWidth, brickHeight, brickDepth);
brick.scaleTextureCoordinates(new Vector2f(1f, .5f));
// bulletAppState.getPhysicsSpace().enableDebug(assetManager);
initMaterial();
initTower();
initFloor();
initCrossHairs();
this.cam.setLocation(new Vector3f(0, 25f, 8f));
cam.lookAt(Vector3f.ZERO, new Vector3f(0, 1, 0));
cam.setFrustumFar(80);
inputManager.addMapping("shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
inputManager.addListener(actionListener, "shoot");
rootNode.setShadowMode(ShadowMode.Off);
bsr = new PssmShadowRenderer(assetManager, 2048, 3);
bsr.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
bsr.setLambda(0.55f);
bsr.setShadowIntensity(0.6f);
bsr.setCompareMode(CompareMode.Hardware);
bsr.setFilterMode(FilterMode.Bilinear);
viewPort.addProcessor(bsr);
}
示例9: initFloor
import com.jme3.scene.shape.Box; //导入方法依赖的package包/类
public void initFloor() {
Box floorBox = new Box(Vector3f.ZERO, 10f, 0.1f, 5f);
floorBox.scaleTextureCoordinates(new Vector2f(3, 6));
Geometry floor = new Geometry("floor", floorBox);
floor.setMaterial(mat3);
floor.setShadowMode(ShadowMode.Receive);
floor.setLocalTranslation(0, 0, 0);
floor.addControl(new RigidBodyControl(0));
this.rootNode.attachChild(floor);
this.getPhysicsSpace().add(floor);
}
示例10: setupFloor
import com.jme3.scene.shape.Box; //导入方法依赖的package包/类
public void setupFloor(){
Material mat = assetManager.loadMaterial("Textures/Terrain/BrickWall/BrickWall.j3m");
mat.getTextureParam("DiffuseMap").getTextureValue().setWrap(WrapMode.Repeat);
mat.getTextureParam("NormalMap").getTextureValue().setWrap(WrapMode.Repeat);
mat.getTextureParam("ParallaxMap").getTextureValue().setWrap(WrapMode.Repeat);
Box floor = new Box(Vector3f.ZERO, 50, 1f, 50);
floor.scaleTextureCoordinates(new Vector2f(5, 5));
Geometry floorGeom = new Geometry("Floor", floor);
floorGeom.setMaterial(mat);
floorGeom.setShadowMode(ShadowMode.Receive);
rootNode.attachChild(floorGeom);
}
示例11: initWall
import com.jme3.scene.shape.Box; //导入方法依赖的package包/类
public void initWall(float bLength, float bWidth, float bHeight) {
Box brick = new Box(Vector3f.ZERO, bLength, bHeight, bWidth);
brick.scaleTextureCoordinates(new Vector2f(1f, .5f));
Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
TextureKey key = new TextureKey("Textures/Terrain/BrickWall/BrickWall.jpg");
key.setGenerateMips(true);
Texture tex = assetManager.loadTexture(key);
mat2.setTexture("ColorMap", tex);
float startpt = bLength / 4;
float height = -5;
for (int j = 0; j < 15; j++) {
for (int i = 0; i < 4; i++) {
Vector3f ori = new Vector3f(i * bLength * 2 + startpt, bHeight + height, -10);
Geometry reBoxg = new Geometry("brick", brick);
reBoxg.setMaterial(mat2);
reBoxg.setLocalTranslation(ori);
//for geometry with sphere mesh the physics system automatically uses a sphere collision shape
reBoxg.addControl(new RigidBodyControl(1.5f));
reBoxg.setShadowMode(ShadowMode.CastAndReceive);
reBoxg.getControl(RigidBodyControl.class).setFriction(0.6f);
this.rootNode.attachChild(reBoxg);
this.getPhysicsSpace().add(reBoxg);
}
startpt = -startpt;
height += 2 * bHeight;
}
}
示例12: simpleInitApp
import com.jme3.scene.shape.Box; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
bulletAppState = new BulletAppState();
bulletAppState.setThreadingType(BulletAppState.ThreadingType.PARALLEL);
// bulletAppState.setEnabled(false);
stateManager.attach(bulletAppState);
bullet = new Sphere(32, 32, 0.4f, true, false);
bullet.setTextureMode(TextureMode.Projected);
bulletCollisionShape = new SphereCollisionShape(0.4f);
brick = new Box(Vector3f.ZERO, brickWidth, brickHeight, brickDepth);
brick.scaleTextureCoordinates(new Vector2f(1f, .5f));
//bulletAppState.getPhysicsSpace().enableDebug(assetManager);
initMaterial();
initTower();
initFloor();
initCrossHairs();
this.cam.setLocation(new Vector3f(0, 25f, 8f));
cam.lookAt(Vector3f.ZERO, new Vector3f(0, 1, 0));
cam.setFrustumFar(80);
inputManager.addMapping("shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
inputManager.addListener(actionListener, "shoot");
rootNode.setShadowMode(ShadowMode.Off);
bsr = new PssmShadowRenderer(assetManager, 1024, 2);
bsr.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
bsr.setLambda(0.55f);
bsr.setShadowIntensity(0.6f);
bsr.setCompareMode(CompareMode.Hardware);
bsr.setFilterMode(FilterMode.PCF4);
viewPort.addProcessor(bsr);
}
示例13: setupFloor
import com.jme3.scene.shape.Box; //导入方法依赖的package包/类
public void setupFloor(){
Material mat = assetManager.loadMaterial("Textures/Terrain/BrickWall/BrickWall.j3m");
mat.getTextureParam("DiffuseMap").getTextureValue().setWrap(WrapMode.Repeat);
mat.getTextureParam("NormalMap").getTextureValue().setWrap(WrapMode.Repeat);
mat.getTextureParam("ParallaxMap").getTextureValue().setWrap(WrapMode.Repeat);
Box floor = new Box(Vector3f.ZERO, 50, 1f, 50);
TangentBinormalGenerator.generate(floor);
floor.scaleTextureCoordinates(new Vector2f(5, 5));
Geometry floorGeom = new Geometry("Floor", floor);
floorGeom.setMaterial(mat);
floorGeom.setShadowMode(ShadowMode.Receive);
rootNode.attachChild(floorGeom);
}
示例14: simpleInitApp
import com.jme3.scene.shape.Box; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
timer = new NanoTimer();
bulletAppState = new BulletAppState();
bulletAppState.setThreadingType(BulletAppState.ThreadingType.PARALLEL);
// bulletAppState.setEnabled(false);
stateManager.attach(bulletAppState);
bullet = new Sphere(32, 32, 0.4f, true, false);
bullet.setTextureMode(TextureMode.Projected);
bulletCollisionShape = new SphereCollisionShape(0.4f);
brick = new Box(Vector3f.ZERO, brickWidth, brickHeight, brickDepth);
brick.scaleTextureCoordinates(new Vector2f(1f, .5f));
//bulletAppState.getPhysicsSpace().enableDebug(assetManager);
initMaterial();
initTower();
initFloor();
initCrossHairs();
this.cam.setLocation(new Vector3f(0, 25f, 8f));
cam.lookAt(Vector3f.ZERO, new Vector3f(0, 1, 0));
cam.setFrustumFar(80);
inputManager.addMapping("shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
inputManager.addListener(actionListener, "shoot");
rootNode.setShadowMode(ShadowMode.Off);
batchNode.batch();
batchNode.setShadowMode(ShadowMode.CastAndReceive);
rootNode.attachChild(batchNode);
bsr = new PssmShadowRenderer(assetManager, 1024, 2);
bsr.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
bsr.setLambda(0.55f);
bsr.setShadowIntensity(0.6f);
bsr.setCompareMode(CompareMode.Hardware);
bsr.setFilterMode(FilterMode.PCF4);
viewPort.addProcessor(bsr);
}
示例15: simpleInitApp
import com.jme3.scene.shape.Box; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
bulletAppState = new BulletAppState();
bulletAppState.setThreadingType(BulletAppState.ThreadingType.PARALLEL);
// bulletAppState.setEnabled(false);
stateManager.attach(bulletAppState);
bullet = new Sphere(32, 32, 0.4f, true, false);
bullet.setTextureMode(TextureMode.Projected);
bulletCollisionShape = new SphereCollisionShape(0.4f);
brick = new Box(Vector3f.ZERO, brickWidth, brickHeight, brickDepth);
brick.scaleTextureCoordinates(new Vector2f(1f, .5f));
// bulletAppState.getPhysicsSpace().enableDebug(assetManager);
initMaterial();
initTower();
initFloor();
initCrossHairs();
List<BatchedGeometry> bgs = batch.batch(geoms);
for (BatchedGeometry bg : bgs) {
RigidBodyControl rb = new RigidBodyControl(1.5f);
rb.setCollisionShape(new BoxCollisionShape(new Vector3f(brick.getXExtent(), brick.getYExtent(), brick.getZExtent())));
rb.setFriction(1.6f);
bg.addControl(rb);
this.getPhysicsSpace().add(bg);
}
batch.setMaterial(mat);
batch.setShadowMode(ShadowMode.CastAndReceive);
this.cam.setLocation(new Vector3f(0, 25f, 8f));
cam.lookAt(Vector3f.ZERO, new Vector3f(0, 1, 0));
cam.setFrustumFar(80);
inputManager.addMapping("shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
inputManager.addListener(actionListener, "shoot");
rootNode.setShadowMode(ShadowMode.Off);
bsr = new PssmShadowRenderer(assetManager, 1024, 2);
bsr.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
bsr.setLambda(0.50f);
bsr.setShadowIntensity(0.6f);
bsr.setCompareMode(CompareMode.Hardware);
bsr.setFilterMode(FilterMode.PCF4);
viewPort.addProcessor(bsr);
flyCam.setMoveSpeed(50);
rootNode.attachChild(batch);
}