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


Java JoyButtonTrigger类代码示例

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


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

示例1: setupFlightJoystickControls

import com.jme3.input.controls.JoyButtonTrigger; //导入依赖的package包/类
public void setupFlightJoystickControls(FlightJoystickControls flightJoystrictControls) {
    if (inputManager.getJoysticks() != null && options.getJoyId().isPresent()) {
        for (Joystick joy : inputManager.getJoysticks()) {
            if (joy.getJoyId() == options.getJoyId().orElse(-1)) {
                inputManager.addMapping(JOY_ROLL_RIGHT, new JoyAxisTrigger(joy.getJoyId(), joy.getXAxisIndex(), false));
                inputManager.addMapping(JOY_ROLL_LEFT, new JoyAxisTrigger(joy.getJoyId(), joy.getXAxisIndex(), true));
                inputManager.addMapping(JOY_PITCH_UP, new JoyAxisTrigger(joy.getJoyId(), joy.getYAxisIndex(), false));
                inputManager.addMapping(JOY_PITCH_DOWN, new JoyAxisTrigger(joy.getJoyId(), joy.getYAxisIndex(), true));
                inputManager.addMapping(Trigger.FIRE.name(), new JoyButtonTrigger(joy.getJoyId(),0));
                break;
            }
        }
    }
    inputManager.addListener(flightJoystrictControls, JOY_PITCH_UP, JOY_PITCH_DOWN, JOY_ROLL_LEFT, JOY_ROLL_RIGHT);
}
 
开发者ID:ZoltanTheHun,项目名称:SkyHussars,代码行数:16,代码来源:ControlsMapper.java

示例2: onJoyButtonEventQueued

import com.jme3.input.controls.JoyButtonTrigger; //导入依赖的package包/类
private void onJoyButtonEventQueued(JoyButtonEvent evt) {
//        for (int i = 0; i < rawListeners.size(); i++){
//            rawListeners.get(i).onJoyButtonEvent(evt);
//        }

        int hash = JoyButtonTrigger.joyButtonHash(evt.getJoyIndex(), evt.getButtonIndex());
        invokeActions(hash, evt.isPressed());
        invokeTimedActions(hash, evt.getTime(), evt.isPressed());
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:InputManager.java

示例3: assignButton

import com.jme3.input.controls.JoyButtonTrigger; //导入依赖的package包/类
/**
 * Assign the mapping name to receive events from the given button index
 * on the joystick.
 * 
 * @param mappingName The mapping to receive joystick button events.
 * @param buttonId The button index.
 * 
 * @see Joystick#getButtonCount() 
 */
public void assignButton(String mappingName, int buttonId){
    if (buttonId < 0 || buttonId >= buttonCount)
        throw new IllegalArgumentException();

    inputManager.addMapping(mappingName, new JoyButtonTrigger(joyId, buttonId));
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:16,代码来源:Joystick.java


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