• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Control类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createFor

import com.jme3.scene.control.Control; //导入依赖的package包/类
@Override
@FXThread
public <T, V extends TreeNode<T>> @Nullable V createFor(@Nullable final T element, final long objectId) {

    if (element instanceof MotionEvent) {
        return unsafeCast(new MotionEventTreeNode((MotionEvent) element, objectId));
    } else if (element instanceof KinematicRagdollControl) {
        return unsafeCast(new RagdollControlTreeNode((KinematicRagdollControl) element, objectId));
    } else if (element instanceof VehicleControl) {
        return unsafeCast(new VehicleControlTreeNode((VehicleControl) element, objectId));
    } else if (element instanceof SkeletonControl) {
        return unsafeCast(new SkeletonControlTreeNode((SkeletonControl) element, objectId));
    } else if (element instanceof CharacterControl) {
        return unsafeCast(new CharacterControlTreeNode((CharacterControl) element, objectId));
    } else if (element instanceof RigidBodyControl) {
        return unsafeCast(new RigidBodyControlTreeNode((RigidBodyControl) element, objectId));
    }  else if (element instanceof LightControl) {
        return unsafeCast(new LightControlTreeNode((LightControl) element, objectId));
    } else if (element instanceof Control) {
        return unsafeCast(new ControlTreeNode<>((Control) element, objectId));
    }

    return null;
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:25,代码来源:ControlTreeNodeFactory.java


示例2: createControl

import com.jme3.scene.control.Control; //导入依赖的package包/类
@Override
@FXThread
protected @NotNull Control createControl(@NotNull final Spatial parent) {

    final MotionPath motionPath = new MotionPath();
    motionPath.addWayPoint(Vector3f.ZERO.clone());
    motionPath.addWayPoint(new Vector3f(0f, 1f, 0f));
    motionPath.addWayPoint(new Vector3f(1f, 0f, 1f));

    final MotionEvent control = new MotionEvent();
    control.setLookAt(Vector3f.UNIT_Z, Vector3f.UNIT_Y);
    control.setRotation(Quaternion.IDENTITY);
    control.setPath(motionPath);

    return control;
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:17,代码来源:CreateMotionControlAction.java


示例3: process

import com.jme3.scene.control.Control; //导入依赖的package包/类
@Override
@FXThread
protected void process() {
    super.process();

    final TreeNode<?> node = getNode();
    final Object element = node.getElement();

    if (!(element instanceof Control)) return;
    final Control control = (Control) element;

    final TreeNode<?> parentNode = node.getParent();

    if (parentNode == null) {
        LOGGER.warning("not found parent node for " + node);
        return;
    }

    final Object parent = parentNode.getElement();

    final NodeTree<ModelChangeConsumer> nodeTree = getNodeTree();
    final ModelChangeConsumer changeConsumer = notNull(nodeTree.getChangeConsumer());
    changeConsumer.execute(new RemoveControlOperation(control, (Spatial) parent));
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:25,代码来源:RemoveControlAction.java


示例4: getChildren

import com.jme3.scene.control.Control; //导入依赖的package包/类
@Override
@FXThread
public @NotNull Array<TreeNode<?>> getChildren(@NotNull final NodeTree<?> nodeTree) {

    final Array<TreeNode<?>> result = ArrayFactory.newArray(TreeNode.class);
    final Spatial element = getElement();

    final LightList lightList = element.getLocalLightList();
    lightList.forEach(light -> {
        if (!(light instanceof InvisibleObject)) {
            result.add(FACTORY_REGISTRY.createFor(light));
        }
    });

    final int numControls = element.getNumControls();

    for (int i = 0; i < numControls; i++) {
        final Control control = element.getControl(i);
        result.add(FACTORY_REGISTRY.createFor(control));
    }

    return result;
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:24,代码来源:SpatialTreeNode.java


示例5: removeControl

import com.jme3.scene.control.Control; //导入依赖的package包/类
/**
 * Removes the first control that is an instance of the given class.
 *
 * @see Spatial#addControl(com.jme3.scene.control.Control)
 */
public void removeControl(Class<? extends Control> controlType) {
    boolean before = requiresUpdates();
    for (int i = 0; i < controls.size(); i++) {
        if (controlType.isAssignableFrom(controls.get(i).getClass())) {
            Control control = controls.remove(i);
            control.setSpatial(null);
            break; // added to match the javadoc  -pspeed
        }
    }
    boolean after = requiresUpdates();
    // If the requirement to be updated has changed
    // then we need to let the parent node know so it
    // can rebuild its update list.
    if( parent != null && before != after ) {
        parent.invalidateUpdateList();
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:23,代码来源:Spatial.java


示例6: cloneForSpatial

import com.jme3.scene.control.Control; //导入依赖的package包/类
/**
 * Clone this control for the given spatial
 * @param spatial
 * @return
 */
public Control cloneForSpatial(Spatial spatial) {
    MotionTrack control = new MotionTrack(spatial, path);
    control.playState = playState;
    control.currentWayPoint = currentWayPoint;
    control.currentValue = currentValue;
    control.direction = direction.clone();
    control.lookAt = lookAt.clone();
    control.upVector = upVector.clone();
    control.rotation = rotation.clone();
    control.duration = duration;
    control.initialDuration = initialDuration;
    control.speed = speed;
    control.duration = duration;
    control.loopMode = loopMode;
    control.directionType = directionType;

    return control;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:24,代码来源:MotionTrack.java


示例7: cloneForSpatial

import com.jme3.scene.control.Control; //导入依赖的package包/类
public Control cloneForSpatial(Spatial spatial) {
    CharacterControl control = new CharacterControl(collisionShape, stepHeight);
    control.setCcdMotionThreshold(getCcdMotionThreshold());
    control.setCcdSweptSphereRadius(getCcdSweptSphereRadius());
    control.setCollideWithGroups(getCollideWithGroups());
    control.setCollisionGroup(getCollisionGroup());
    control.setFallSpeed(getFallSpeed());
    control.setGravity(getGravity());
    control.setJumpSpeed(getJumpSpeed());
    control.setMaxSlope(getMaxSlope());
    control.setPhysicsLocation(getPhysicsLocation());
    control.setUpAxis(getUpAxis());
    control.setApplyPhysicsLocal(isApplyPhysicsLocal());

    control.setSpatial(spatial);
    return control;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:18,代码来源:CharacterControl.java


示例8: loadRB

import com.jme3.scene.control.Control; //导入依赖的package包/类
protected boolean loadRB(RelationsMerger rloader, RefData data, Logger log) {
	RigidBody op1=getRef1(data,RigidBody.class,log);
	Spatial op2=getRef2(data,Spatial.class,log);
	if(op1==null||op2==null) return false;
	PhysicsLoader<?,?> loader=data.context.getSettings().getPhysicsLoader();
	if(loader!=null){
		Savable pc=loader.load(data.context.getSettings(),op2,op1);
		log.debug("Load rigidbody {}",data.ref1);
		if(pc!=null&&pc instanceof Control){
			op2.addControl((Control)pc);
			String linkRef="G~slink4phy~"+System.currentTimeMillis()+"~"+data.ref1;
			data.context.put(linkRef,op2,data.ref1);
			applyCTs(op2,data.ref1,data.context,data.root);
		}
	}
	return true;
}
 
开发者ID:xbuf,项目名称:jme3_xbuf,代码行数:18,代码来源:PhysicsToSpatial.java


示例9: addEntity

import com.jme3.scene.control.Control; //导入依赖的package包/类
@Override
public void addEntity(Entity e) {        
    spatials.put(e.getId(), initialiseSpatial(e));
    Spatial parent = spatials.get(e.get(RenderComponent.class).getParent());
    if (parent != null) {
        ((Node) parent).attachChild(spatials.get(e.getId()));
    } else if (getSubSystemNode(e.get(RenderComponent.class).getSubSystem()) != null) {
        addSpatialToSubSystem(e.getId(), e.get(RenderComponent.class).getSubSystem());
    } else {
        renderSystemNode.attachChild(spatials.get(e.getId()));
    }

    Control[] control = e.get(RenderComponent.class).getControl();
    if (control != null) {
        Spatial s = spatials.get(e.getId());
        for (Control c : control) {
            s.addControl(c);
        }
    }

    if (!e.get(RenderComponent.class).isVisible()) {
        spatials.get(e.getId()).setCullHint(Spatial.CullHint.Always);
    }

}
 
开发者ID:MultiverseKing,项目名称:MultiverseKing_JME,代码行数:26,代码来源:RenderSystem.java


示例10: cloneForSpatial

import com.jme3.scene.control.Control; //导入依赖的package包/类
@Override
public Control cloneForSpatial(Spatial spatial) {
    System.out.println("Making skeleton clone for :" + spatial.getName());
    Node clonedNode = (Node) spatial;

    DAESkeletonControl clone = new DAESkeletonControl();
    clone.setSkeleton((DAESkeleton) this.skeleton.clone());
    clone.setSpatial(clonedNode);

    Mesh[] meshes = new Mesh[targets.length];
    for (int i = 0; i < meshes.length; i++) {
        meshes[i] = ((Geometry) clonedNode.getChild(i)).getMesh();
    }
    clone.targets = meshes;
    return clone;
}
 
开发者ID:samynk,项目名称:DArtE,代码行数:17,代码来源:DAESkeletonControl.java


示例11: cloneForSpatial

import com.jme3.scene.control.Control; //导入依赖的package包/类
/**
 * Internal use only.
 */
public Control cloneForSpatial(Spatial spatial) {
    try {
        AnimControl clone = (AnimControl) super.clone();
        clone.spatial = spatial;
        clone.channels = new ArrayList<AnimChannel>();
        clone.listeners = new ArrayList<AnimEventListener>();

        if (skeleton != null) {
            clone.skeleton = new Skeleton(skeleton);
        }

        // animationMap is cloned, but only ClonableTracks will be cloned as they need a reference to a cloned spatial
        for (Entry<String, Animation> animEntry : animationMap.entrySet()) {
            clone.animationMap.put(animEntry.getKey(), animEntry.getValue().cloneForSpatial(spatial));
        }
        
        return clone;
    } catch (CloneNotSupportedException ex) {
        throw new AssertionError();
    }
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:25,代码来源:AnimControl.java


示例12: cloneForSpatial

import com.jme3.scene.control.Control; //导入依赖的package包/类
/**
 * Clone this control for the given spatial
 * @param spatial
 * @return
 */
public Control cloneForSpatial(Spatial spatial) {
    MotionTrack control = new MotionTrack(spatial, path);
    control.playState = playState;
    control.currentWayPoint = currentWayPoint;
    control.currentValue = currentValue;
    control.direction = direction.clone();
    control.lookAt = lookAt.clone();
    control.upVector = upVector.clone();
    control.rotation = rotation.clone();
    control.initialDuration = initialDuration;
    control.speed = speed;
    control.loopMode = loopMode;
    control.directionType = directionType;

    return control;
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:22,代码来源:MotionTrack.java


示例13: createSheet

import com.jme3.scene.control.Control; //导入依赖的package包/类
@Override
protected Sheet createSheet() {
    //TODO: multithreading..
    Sheet sheet = Sheet.createDefault();
    Sheet.Set set = Sheet.createPropertiesSet();
    set.setDisplayName("Control");
    set.setName(Control.class.getName());
    if (control == null) {
        return sheet;
    }

    createFields(control.getClass(), set, control);

    sheet.put(set);
    return sheet;

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


示例14: cloneForSpatial

import com.jme3.scene.control.Control; //导入依赖的package包/类
/**
 * Utility method for cloning this object to another Spatial. Useful for
 * controlling many Spatials with the same setup.
 *
 * @param spatial
 *            The Spatial which will receive the newly created Control.
 * @return control The newly created Control, with the same field values as
 *         this.
 */
@Override
public Control cloneForSpatial(Spatial spatial) {
	ForceCharacterControl control = new ForceCharacterControl(collisionShape, stepHeight, forceDamping);
	control.setCcdMotionThreshold(getCcdMotionThreshold());
	control.setCcdSweptSphereRadius(getCcdSweptSphereRadius());
	control.setCollideWithGroups(getCollideWithGroups());
	control.setCollisionGroup(getCollisionGroup());
	control.setFallSpeed(getFallSpeed());
	control.setGravity(getGravity());
	control.setJumpSpeed(getJumpSpeed());
	control.setMaxSlope(getMaxSlope());
	control.setPhysicsLocation(getPhysicsLocation());
	control.setUpAxis(getUpAxis());
	control.setApplyPhysicsLocal(isApplyPhysicsLocal());

	control.setForceDamping(getForceDamping());
	control.setMinimalForceAmount(getMinimalForceAmount());

	control.setSpatial(spatial);
	return control;
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:31,代码来源:ForceCharacterControl.java


示例15: cloneForSpatial

import com.jme3.scene.control.Control; //导入依赖的package包/类
@Override
public Control cloneForSpatial(Spatial spatial) {
    GISLodControl clone = (GISLodControl) super.cloneForSpatial(spatial);
    clone.lastDistance = 0;
    clone.lastLevel = 0;
    clone.numTris = numTris != null ? numTris.clone() : null;
    return clone;
}
 
开发者ID:twak,项目名称:chordatlas,代码行数:9,代码来源:GISLodControl.java


示例16: updateNode

import com.jme3.scene.control.Control; //导入依赖的package包/类
/**
 * Update a spatial.
 *
 * @param spatial      the spatial.
 * @param physicsSpace the new physical space or null.
 */
private void updateNode(@NotNull final Spatial spatial, @Nullable final PhysicsSpace physicsSpace) {
    spatial.depthFirstTraversal(spatial1 -> {

        final int numControls = spatial1.getNumControls();

        for (int i = 0; i < numControls; i++) {
            final Control control = spatial1.getControl(i);
            if (control instanceof PhysicsControl) {
                ((PhysicsControl) control).setPhysicsSpace(physicsSpace);
            }
        }
    });
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:20,代码来源:ModelEditorBulletState.java


示例17: cloneForSpatial

import com.jme3.scene.control.Control; //导入依赖的package包/类
/**
 * clone this camera for a spatial
 */
@Override
public Control cloneForSpatial(Spatial spatial) {

    final EditorCamera editorCamera = new EditorCamera(camera, spatial);
    editorCamera.setMaxDistance(getMaxDistance());
    editorCamera.setMinDistance(getMinDistance());

    if (inputManager != null) {
        editorCamera.registerInput(inputManager);
    }

    return editorCamera;
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:17,代码来源:EditorCamera.java


示例18: buildForImpl

import com.jme3.scene.control.Control; //导入依赖的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 AbstractCinematicEvent) {
        build((AbstractCinematicEvent) object, container, changeConsumer);
    }  else if (object instanceof VehicleWheel) {
        build((VehicleWheel) object, container, changeConsumer);
    } else if (object instanceof Animation) {
        build((Animation) object, container, changeConsumer);
    }

    if (!(object instanceof Control)) return;

    if (object instanceof AbstractControl) {
        build((AbstractControl) object, container, changeConsumer);
    }

    super.buildForImpl(object, parent, container, changeConsumer);

    if (object instanceof SkeletonControl) {
        build((SkeletonControl) object, container, changeConsumer);
    } else if (object instanceof CharacterControl) {
        build((CharacterControl) object, container, changeConsumer);
    } else if (object instanceof RigidBodyControl) {
        build((RigidBodyControl) object, container, changeConsumer);
    } else if (object instanceof VehicleControl) {
        build((VehicleControl) object, container, changeConsumer);
    } else if (object instanceof MotionEvent) {
        build((MotionEvent) object, container, changeConsumer);
    }

    if (object instanceof PhysicsRigidBody) {
        build((PhysicsRigidBody) object, container, changeConsumer);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:38,代码来源:DefaultControlPropertyBuilder.java


示例19: updateItem

import com.jme3.scene.control.Control; //导入依赖的package包/类
@Override
protected void updateItem(@Nullable final Class<? extends Control> item, final boolean empty) {
    super.updateItem(item, empty);

    if (item == null) {
        setText(StringUtils.EMPTY);
    } else {
        setText(item.getSimpleName());
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:11,代码来源:CreateCustomControlDialog.java


示例20: process

import com.jme3.scene.control.Control; //导入依赖的package包/类
@Override
@FXThread
protected void process() {
    super.process();

    final TreeNode<?> treeNode = getNode();
    final Spatial parent = (Spatial) treeNode.getElement();

    final NodeTree<ModelChangeConsumer> nodeTree = getNodeTree();
    final Control control = createControl(parent);

    final ModelChangeConsumer consumer = notNull(nodeTree.getChangeConsumer());
    consumer.execute(new AddControlOperation(control, parent));
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:15,代码来源:AbstractCreateControlAction.java



注:本文中的com.jme3.scene.control.Control类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BMPConstants类代码示例发布时间:2022-05-21
下一篇:
Java SwingLazyValue类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap