mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-23 09:34:35 -05:00
BlockModel shouldn't always use LocalPlayer's modelname, fixes #82.
This commit is contained in:
parent
3d9d2a0e76
commit
8a076102f4
11 changed files with 21 additions and 23 deletions
|
@ -11,7 +11,7 @@ namespace ClassicalSharp {
|
||||||
|
|
||||||
/// <summary> Gets the position of the player's eye in the world. </summary>
|
/// <summary> Gets the position of the player's eye in the world. </summary>
|
||||||
public Vector3 EyePosition {
|
public Vector3 EyePosition {
|
||||||
get { return new Vector3( Position.X, Position.Y + Model.EyeY, Position.Z ); }
|
get { return new Vector3( Position.X, Position.Y + Model.GetEyeY( this ), Position.Z ); }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Game game;
|
protected Game game;
|
||||||
|
|
|
@ -14,11 +14,9 @@ namespace ClassicalSharp.Model {
|
||||||
get { return blockHeight + 0.075f; }
|
get { return blockHeight + 0.075f; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float EyeY {
|
public override float GetEyeY( Player player ) {
|
||||||
get {
|
byte block = Byte.Parse( player.ModelName );
|
||||||
byte block = Byte.Parse( game.LocalPlayer.ModelName );
|
return block == 0 ? 1 : game.BlockInfo.BlockHeight( block );
|
||||||
return block == 0 ? 1 : game.BlockInfo.BlockHeight( block );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const float adjust = 0.1f;
|
const float adjust = 0.1f;
|
||||||
|
|
|
@ -49,8 +49,8 @@ namespace ClassicalSharp.Model {
|
||||||
get { return 1.0125f; }
|
get { return 1.0125f; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float EyeY {
|
public override float GetEyeY( Player player ) {
|
||||||
get { return 14/16f; }
|
return 14/16f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Vector3 CollisionSize {
|
public override Vector3 CollisionSize {
|
||||||
|
|
|
@ -32,8 +32,8 @@ namespace ClassicalSharp.Model {
|
||||||
get { return 1.7f; }
|
get { return 1.7f; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float EyeY {
|
public override float GetEyeY( Player player ) {
|
||||||
get { return 22/16f; }
|
return 22/16f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Vector3 CollisionSize {
|
public override Vector3 CollisionSize {
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace ClassicalSharp.Model {
|
||||||
|
|
||||||
public abstract float NameYOffset { get; }
|
public abstract float NameYOffset { get; }
|
||||||
|
|
||||||
public abstract float EyeY { get; }
|
public abstract float GetEyeY( Player player );
|
||||||
|
|
||||||
public abstract Vector3 CollisionSize { get; }
|
public abstract Vector3 CollisionSize { get; }
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,8 @@ namespace ClassicalSharp.Model {
|
||||||
get { return 1.075f; }
|
get { return 1.075f; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float EyeY {
|
public override float GetEyeY( Player player ) {
|
||||||
get { return 12/16f; }
|
return 12/16f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Vector3 CollisionSize {
|
public override Vector3 CollisionSize {
|
||||||
|
|
|
@ -70,8 +70,8 @@ namespace ClassicalSharp.Model {
|
||||||
get { return 2.1375f; }
|
get { return 2.1375f; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float EyeY {
|
public override float GetEyeY( Player player ) {
|
||||||
get { return 26/16f; }
|
return 26/16f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Vector3 CollisionSize {
|
public override Vector3 CollisionSize {
|
||||||
|
|
|
@ -55,8 +55,8 @@ namespace ClassicalSharp.Model {
|
||||||
get { return Fur ? 1.48125f: 1.075f; }
|
get { return Fur ? 1.48125f: 1.075f; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float EyeY {
|
public override float GetEyeY( Player player ) {
|
||||||
get { return 20/16f; }
|
return 20/16f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Vector3 CollisionSize {
|
public override Vector3 CollisionSize {
|
||||||
|
|
|
@ -43,8 +43,8 @@ namespace ClassicalSharp.Model {
|
||||||
get { return 2.075f; }
|
get { return 2.075f; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float EyeY {
|
public override float GetEyeY( Player player ) {
|
||||||
get { return 26/16f; }
|
return 26/16f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Vector3 CollisionSize {
|
public override Vector3 CollisionSize {
|
||||||
|
|
|
@ -34,8 +34,8 @@ namespace ClassicalSharp.Model {
|
||||||
get { return 1.0125f; }
|
get { return 1.0125f; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float EyeY {
|
public override float GetEyeY( Player player ) {
|
||||||
get { return 8/16f; }
|
return 8/16f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Vector3 CollisionSize {
|
public override Vector3 CollisionSize {
|
||||||
|
|
|
@ -44,8 +44,8 @@ namespace ClassicalSharp.Model {
|
||||||
get { return 2.075f; }
|
get { return 2.075f; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override float EyeY {
|
public override float GetEyeY( Player player ) {
|
||||||
get { return 26/16f; }
|
return 26/16f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Vector3 CollisionSize {
|
public override Vector3 CollisionSize {
|
||||||
|
|
Loading…
Add table
Reference in a new issue