当前位置: 首页>>代码示例>>Java>>正文


Java Control类代码示例

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


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


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