• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java EmitterBoxShape类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.jme3.effect.shapes.EmitterBoxShape的典型用法代码示例。如果您正苦于以下问题:Java EmitterBoxShape类的具体用法?Java EmitterBoxShape怎么用?Java EmitterBoxShape使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

EmitterBoxShape类属于com.jme3.effect.shapes包,在下文中一共展示了EmitterBoxShape类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: buildForImpl

点赞 3

import com.jme3.effect.shapes.EmitterBoxShape; //导入依赖的package包/类
@Override
@FXThread
protected void buildForImpl(@NotNull final Object object, @Nullable final Object parent,
                            @NotNull final VBox container, @NotNull final ModelChangeConsumer changeConsumer) {

    if (!(object instanceof EmitterShape)) return;

    final EmitterShape shape = (EmitterShape) object;

    if (shape instanceof EmitterPointShape) {
        createControls(container, changeConsumer, (EmitterPointShape) object);
    } else if (shape instanceof EmitterBoxShape) {
        createControls(container, changeConsumer, (EmitterBoxShape) object);
    } else if (shape instanceof EmitterSphereShape) {
        createControls(container, changeConsumer, (EmitterSphereShape) object);
    }
}
 

开发者ID:JavaSaBr,
项目名称:jmonkeybuilder,
代码行数:18,
代码来源:EmitterShapePropertyBuilder.java

示例2: createControls

点赞 3

import com.jme3.effect.shapes.EmitterBoxShape; //导入依赖的package包/类
/**
 * Create controls.
 *
 * @param container      the container.
 * @param changeConsumer the change consumer.
 * @param shape          the shape.
 */
@FXThread
private void createControls(@NotNull final VBox container, @NotNull final ModelChangeConsumer changeConsumer,
                            @NotNull final EmitterBoxShape shape) {

    final Vector3f length = shape.getLen();
    final Vector3f min = shape.getMin();

    final Vector3FPropertyControl<ModelChangeConsumer, EmitterBoxShape> lengthControl =
            new Vector3FPropertyControl<>(length, Messages.MODEL_PROPERTY_LENGTH, changeConsumer);

    lengthControl.setSyncHandler(EmitterBoxShape::getLen);
    lengthControl.setApplyHandler(EmitterBoxShape::setLen);
    lengthControl.setEditObject(shape);

    final Vector3FPropertyControl<ModelChangeConsumer, EmitterBoxShape> minControl =
            new Vector3FPropertyControl<>(min, Messages.MODEL_PROPERTY_MIN, changeConsumer);

    minControl.setSyncHandler(EmitterBoxShape::getMin);
    minControl.setApplyHandler(EmitterBoxShape::setMin);
    minControl.setEditObject(shape);

    FXUtils.addToPane(lengthControl, container);
    FXUtils.addToPane(minControl, container);
}
 

开发者ID:JavaSaBr,
项目名称:jmonkeybuilder,
代码行数:32,
代码来源:EmitterShapePropertyBuilder.java

示例3: simpleInitApp

点赞 3

import com.jme3.effect.shapes.EmitterBoxShape; //导入依赖的package包/类
@Override
public void simpleInitApp() {
    ParticleEmitter emit = new ParticleEmitter("Emitter", Type.Point, 10000);
    emit.setShape(new EmitterBoxShape(new Vector3f(-1.8f, -1.8f, -1.8f),
                                      new Vector3f(1.8f, 1.8f, 1.8f)));
    emit.setGravity(0, 0, 0);
    emit.setLowLife(60);
    emit.setHighLife(60);
    emit.setInitialVelocity(new Vector3f(0, 0, 0));
    emit.setImagesX(15);
    emit.setStartSize(0.05f);
    emit.setEndSize(0.05f);
    emit.setStartColor(ColorRGBA.White);
    emit.setEndColor(ColorRGBA.White);
    emit.setSelectRandomImage(true);
    emit.emitAllParticles();
    
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
    mat.setBoolean("PointSprite", true);
    mat.setTexture("Texture", assetManager.loadTexture("Effects/Smoke/Smoke.png"));
    emit.setMaterial(mat);

    rootNode.attachChild(emit);
    
}
 

开发者ID:mleoking,
项目名称:PhET,
代码行数:26,
代码来源:TestPointSprite.java

示例4: createEmitterShape

点赞 2

import com.jme3.effect.shapes.EmitterBoxShape; //导入依赖的package包/类
@Override
@FXThread
protected @NotNull EmitterShape createEmitterShape(@NotNull final VarTable vars) {
    final Vector3f min = vars.get(PROPERTY_MIN);
    final Vector3f max = vars.get(PROPERTY_MAX);
    return new EmitterBoxShape(min, max);
}
 

开发者ID:JavaSaBr,
项目名称:jmonkeybuilder,
代码行数:8,
代码来源:CreateBoxShapeEmitterAction.java

示例5: simpleInitApp

点赞 2

import com.jme3.effect.shapes.EmitterBoxShape; //导入依赖的package包/类
@Override
public void simpleInitApp() {
    final ParticleEmitter emit = new ParticleEmitter("Emitter", Type.Point, 10000);
    emit.setShape(new EmitterBoxShape(new Vector3f(-1.8f, -1.8f, -1.8f),
                                      new Vector3f(1.8f, 1.8f, 1.8f)));
    emit.setGravity(0, 0, 0);
    emit.setLowLife(60);
    emit.setHighLife(60);
    emit.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 0, 0));
    emit.setImagesX(15);
    emit.setStartSize(0.05f);
    emit.setEndSize(0.05f);
    emit.setStartColor(ColorRGBA.White);
    emit.setEndColor(ColorRGBA.White);
    emit.setSelectRandomImage(true);
    emit.emitAllParticles();
    
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
    mat.setBoolean("PointSprite", true);
    mat.setTexture("Texture", assetManager.loadTexture("Effects/Smoke/Smoke.png"));
    emit.setMaterial(mat);

    rootNode.attachChild(emit);
    inputManager.addListener(new ActionListener() {
        
        public void onAction(String name, boolean isPressed, float tpf) {
            if ("setNum".equals(name) && isPressed) {
                emit.setNumParticles(5000);
                emit.emitAllParticles();
            }
        }
    }, "setNum");
    
    inputManager.addMapping("setNum", new KeyTrigger(KeyInput.KEY_SPACE));
    
}
 

开发者ID:chototsu,
项目名称:MikuMikuStudio,
代码行数:37,
代码来源:TestPointSprite.java

示例6: EmitterBoxShapeTreeNode

点赞 2

import com.jme3.effect.shapes.EmitterBoxShape; //导入依赖的package包/类
public EmitterBoxShapeTreeNode(@NotNull final EmitterBoxShape element, final long objectId) {
    super(element, objectId);
}
 

开发者ID:JavaSaBr,
项目名称:jmonkeybuilder,
代码行数:4,
代码来源:EmitterBoxShapeTreeNode.java

示例7: setData

点赞 2

import com.jme3.effect.shapes.EmitterBoxShape; //导入依赖的package包/类
@Override
public void setData(T data) {
    super.setData(data);
    shape = new EmitterBoxShape(data.getAsVector3f("min"), data.getAsVector3f("max"));
}
 

开发者ID:huliqing,
项目名称:LuoYing,
代码行数:6,
代码来源:RandomBoxPosition.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)