Java Code Examples for codechicken.lib.vec.Vector3#vec3()

The following examples show how to use codechicken.lib.vec.Vector3#vec3() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RayTracer.java    From CodeChickenLib with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static Vec3 getCorrectedHeadVec(EntityPlayer player) {
    Vector3 v = Vector3.fromEntity(player);
    if (player.worldObj.isRemote) {
        v.y += player.getEyeHeight() - player.getDefaultEyeHeight();//compatibility with eye height changing mods
    } else {
        v.y += player.getEyeHeight();
        if (player instanceof EntityPlayerMP && player.isSneaking())
            v.y -= 0.08;
    }
    return v.vec3();
}
 
Example 2
Source File: DistanceRayTraceResult.java    From CodeChickenLib with GNU Lesser General Public License v2.1 4 votes vote down vote up
public DistanceRayTraceResult(Vector3 hitVec, Direction faceIn, BlockPos posIn, boolean isInside, Object data, double dist) {
    this(false, hitVec.vec3(), faceIn, posIn, isInside, data, dist);
}
 
Example 3
Source File: RayTracer.java    From CodeChickenLib with GNU Lesser General Public License v2.1 4 votes vote down vote up
public static Vec3d getCorrectedHeadVec(PlayerEntity player) {
    Vector3 v = Vector3.fromEntity(player).add(0, player.getEyeHeight(), 0);
    return v.vec3();
}
 
Example 4
Source File: ExtendedMOP.java    From CodeChickenLib with GNU Lesser General Public License v2.1 4 votes vote down vote up
public ExtendedMOP(Entity entity, Vector3 hit, Object data, double dist) {
    super(entity, hit.vec3());
    setData(data);
    this.dist = dist;
}
 
Example 5
Source File: ExtendedMOP.java    From CodeChickenLib with GNU Lesser General Public License v2.1 4 votes vote down vote up
public ExtendedMOP(Vector3 hit, int side, BlockCoord pos, Object data, double dist) {
    super(hit.vec3(), EnumFacing.values()[side], pos.pos());
    setData(data);
    this.dist = dist;
}