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


Java Vector3d.ZERO属性代码示例

本文整理汇总了Java中com.flowpowered.math.vector.Vector3d.ZERO属性的典型用法代码示例。如果您正苦于以下问题:Java Vector3d.ZERO属性的具体用法?Java Vector3d.ZERO怎么用?Java Vector3d.ZERO使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.flowpowered.math.vector.Vector3d的用法示例。


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

示例1: getPickaxeRot

private Vector3d getPickaxeRot() {
    Direction facing = Utils.rotationToDirection(this.rotation.getY());
    if (facing == Direction.NORTH) {
        return new Vector3d(0, 180, 0);
    }
    if (facing == Direction.EAST) {
        return new Vector3d(0, 270, 0);
    }
    if (facing == Direction.SOUTH) {
        return Vector3d.ZERO;
    }
    if (facing == Direction.WEST) {
        return new Vector3d(0, 90, 0);
    }
    return this.rotation;
}
 
开发者ID:simon816,项目名称:Industrialization,代码行数:16,代码来源:TurtleEntity.java

示例2: GUIModel

@Builder
private GUIModel(@NonNull Object plugin, @NonNull TextureId textureId, ItemType itemType, Vector3d textureOffset, Vector2d textureSize, Vector4d uvRegion) {
    Preconditions.checkArgument(itemType == null || ItemStack.builder().itemType(itemType).build().get(Keys.ITEM_DURABILITY).isPresent(),
            "The specified type of itemStackSnapshot doesn't have a durability.");

    this.pluginContainer = Sponge.getPluginManager().fromInstance(plugin)
            .orElseThrow(() -> new IllegalArgumentException("Invalid plugin instance."));
    this.textureId = textureId.getDirectory().isPresent() ? textureId : textureId.toBuilder().directory(
            SimpleCustomInventoryRegistry.MODEL_DIRECTORY_NAME).build();
    this.itemType = itemType != null ? itemType : DEFAULT_ITEM_TYPE;
    this.textureOffset = textureOffset != null ? textureOffset : Vector3d.ZERO;
    this.textureSize = textureSize != null ? textureSize : Vector2d.from(16);
    this.uvRegion = uvRegion != null ? uvRegion : Vector4d.from(0, 0, this.textureSize.getX(), this.textureSize.getY());
}
 
开发者ID:Limeth,项目名称:CustomItemLibrary,代码行数:14,代码来源:GUIModel.java

示例3: getPosition

public Vector3d getPosition() {
	return Vector3d.ZERO;
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:3,代码来源:EVirtualEmpty.java

示例4: getRotation

@Override
public Vector3d getRotation() {
	return Vector3d.ZERO;
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:4,代码来源:EVirtualEmpty.java

示例5: getRotation

public Vector3d getRotation() {
	return Vector3d.ZERO;
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:3,代码来源:EVirtualPosition.java

示例6: getRotation

public Vector3d getRotation() {
    return rotation != null ? rotation : Vector3d.ZERO;
}
 
开发者ID:Valandur,项目名称:Web-API,代码行数:3,代码来源:CreateJailRequest.java

示例7: placeBlock

/**
 * Constructs a custom block and places it in the world.
 *
 * @param block The block location
 * @param cause The cause
 * @return The wrapped block
 */
default T placeBlock(Block block, BlockChangeFlag flag, Cause cause) {
    Location<World> location = block.getLocation()
            .orElseThrow(() -> new IllegalStateException("Could not access the location of the provided block."));
    World world = location.getExtent();

    // Remove the previous custom block
    CustomItemLibrary.getInstance().getService().removeArmorStandsAt(block);

    location.setBlockType(CustomBlock.BLOCK_TYPE_CUSTOM, flag, cause);

    ArmorStand armorStand = createDummyArmorStand(block);
    Vector3d rotation = Vector3d.ZERO;

    if(isRotateHorizontally()) {
        Optional<Player> player = cause.first(Player.class);

        if(player.isPresent()) {
            Vector3d headRotation = player.get().getHeadRotation();
            double angle = Math.floorMod(180 + (int) Math.floor(headRotation.getY()), 360);
            angle += 45;
            angle = Math.floorMod((int) Math.floor(angle), 360);
            angle = (int) (angle / 90);
            angle = angle * 90;
            rotation = Vector3d.from(0, angle, 0);
        }
    }

    armorStand.offer(createDefaultCustomFeatureData());
    armorStand.offer(new CustomBlockData());
    armorStand.setRotation(rotation);

    world.spawnEntity(armorStand, cause);

    T result = customizeBlock(block, armorStand, cause);

    result.setModel(getDefaultModel());
    CustomItemLibrary.getInstance().getService().registerBlockAsLoaded(result);

    return result;
}
 
开发者ID:Limeth,项目名称:CustomItemLibrary,代码行数:47,代码来源:CustomBlockDefinition.java


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