mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 03:25:14 -04:00
Start work on new humanoidmodel code (Big thanks to goodlyay).
This commit is contained in:
parent
7af045f9a9
commit
f6002ffa0b
@ -70,7 +70,7 @@ namespace ClassicalSharp {
|
||||
|
||||
void DrawBackgroundVertices( ref int index, int atlasIndex, ref bool bound ) {
|
||||
if( index == 0 ) return;
|
||||
if (!bound) {
|
||||
if( !bound ) {
|
||||
bound = true;
|
||||
graphicsApi.BindTexture( game.TerrainAtlas1D.TexIds[atlasIndex] );
|
||||
}
|
||||
|
@ -10,30 +10,30 @@ namespace ClassicalSharp.Model {
|
||||
vertices = new ModelVertex[boxVertices * (7 + 2)];
|
||||
|
||||
Head = BuildBox( MakeBoxBounds( -4, 12, -4, 4, 20, 4 )
|
||||
.SetTexOrigin( 0, 0 )
|
||||
.SetRotOrigin( 0, 13, 0 ) );
|
||||
.TexOrigin( 0, 0 )
|
||||
.RotOrigin( 0, 13, 0 ) );
|
||||
Hat = BuildBox( MakeBoxBounds( -4, 12, -4, 4, 20, 4 )
|
||||
.SetTexOrigin( 32, 0 ).ExpandBounds( 0.25f )
|
||||
.SetRotOrigin( 0, 13, 0 ) );
|
||||
.TexOrigin( 32, 0 ).Expand( 0.25f )
|
||||
.RotOrigin( 0, 13, 0 ) );
|
||||
Torso = BuildBox( MakeBoxBounds( -4, -6, -2, 4, 6, 2 )
|
||||
.SetTexOrigin( 16, 16 )
|
||||
.TexOrigin( 16, 16 )
|
||||
.SetModelBounds( -2, 6, -1, 2, 12, 1 ) );
|
||||
LeftLeg = BuildBox( MakeBoxBounds( -2, -6, -2, 2, 6, 2 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.TexOrigin( 0, 16 )
|
||||
.SetModelBounds( -0, 0, -1, -2, 6, 1 )
|
||||
.SetRotOrigin( 0, 6, 0 ) );
|
||||
.RotOrigin( 0, 6, 0 ) );
|
||||
RightLeg = BuildBox( MakeBoxBounds( -2, -6, -2, 2, 6, 2 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.TexOrigin( 0, 16 )
|
||||
.SetModelBounds( 0, 0, -1, 2, 6, 1 )
|
||||
.SetRotOrigin( 0, 6, 0 ) );
|
||||
.RotOrigin( 0, 6, 0 ) );
|
||||
LeftArm = BuildBox( MakeBoxBounds( -2, -6, -2, 2, 6, 2 )
|
||||
.SetTexOrigin( 40, 16 )
|
||||
.TexOrigin( 40, 16 )
|
||||
.SetModelBounds( -2, 6, -1, -4, 12, 1 )
|
||||
.SetRotOrigin( -3, 11, 0 ) );
|
||||
.RotOrigin( -3, 11, 0 ) );
|
||||
RightArm = BuildBox( MakeBoxBounds( -2, -6, -2, 2, 6, 2 )
|
||||
.SetTexOrigin( 40, 16 )
|
||||
.TexOrigin( 40, 16 )
|
||||
.SetModelBounds( 2, 6, -1, 4, 12, 1 )
|
||||
.SetRotOrigin( 3, 11, 0 ) );
|
||||
.RotOrigin( 3, 11, 0 ) );
|
||||
}
|
||||
|
||||
public override bool Bobbing { get { return true; } }
|
||||
|
@ -9,25 +9,25 @@ namespace ClassicalSharp.Model {
|
||||
public ChickenModel( Game window ) : base( window ) {
|
||||
vertices = new ModelVertex[boxVertices * 6 + quadVertices * 2 * 2];
|
||||
Head = BuildBox( MakeBoxBounds( -2, 9, -6, 2, 15, -3 )
|
||||
.SetTexOrigin( 0, 0 )
|
||||
.SetRotOrigin( 0, 9, -4 ) );
|
||||
.TexOrigin( 0, 0 )
|
||||
.RotOrigin( 0, 9, -4 ) );
|
||||
Head2 = BuildBox( MakeBoxBounds( -1, 9, -7, 1, 11, -5 )
|
||||
.SetTexOrigin( 14, 4 ) // TODO: Find a more appropriate name.
|
||||
.SetRotOrigin( 0, 9, -4 ) );
|
||||
.TexOrigin( 14, 4 ) // TODO: Find a more appropriate name.
|
||||
.RotOrigin( 0, 9, -4 ) );
|
||||
Head3 = BuildBox( MakeBoxBounds( -2, 11, -8, 2, 13, -6 )
|
||||
.SetTexOrigin( 14, 0 )
|
||||
.SetRotOrigin( 0, 9, -4 ) );
|
||||
.TexOrigin( 14, 0 )
|
||||
.RotOrigin( 0, 9, -4 ) );
|
||||
Torso = BuildRotatedBox( MakeRotatedBoxBounds( -3, 5, -4, 3, 11, 3 )
|
||||
.SetTexOrigin( 0, 9 ) );
|
||||
.TexOrigin( 0, 9 ) );
|
||||
|
||||
LeftLeg = MakeLeg( -3, 0, -2, -1 );
|
||||
RightLeg = MakeLeg( 0, 3, 1, 2 );
|
||||
LeftWing = BuildBox( MakeBoxBounds( -4, 7, -3, -3, 11, 3 )
|
||||
.SetTexOrigin( 24, 13 )
|
||||
.SetRotOrigin( -3, 11, 0 ) );
|
||||
.TexOrigin( 24, 13 )
|
||||
.RotOrigin( -3, 11, 0 ) );
|
||||
RightWing = BuildBox( MakeBoxBounds( 3, 7, -3, 4, 11, 3 )
|
||||
.SetTexOrigin( 24, 13 )
|
||||
.SetRotOrigin( 3, 11, 0 ) );
|
||||
.TexOrigin( 24, 13 )
|
||||
.RotOrigin( 3, 11, 0 ) );
|
||||
}
|
||||
|
||||
ModelPart MakeLeg( int x1, int x2, int legX1, int legX2 ) {
|
||||
|
@ -9,23 +9,23 @@ namespace ClassicalSharp.Model {
|
||||
public CreeperModel( Game window ) : base( window ) {
|
||||
vertices = new ModelVertex[boxVertices * 6];
|
||||
Head = BuildBox( MakeBoxBounds( -4, 18, -4, 4, 26, 4 )
|
||||
.SetTexOrigin( 0, 0 )
|
||||
.SetRotOrigin( 0, 18, 0 ) );
|
||||
.TexOrigin( 0, 0 )
|
||||
.RotOrigin( 0, 18, 0 ) );
|
||||
Torso = BuildBox( MakeBoxBounds( -4, 6, -2, 4, 18, 2 )
|
||||
.SetTexOrigin( 16, 16 ) );
|
||||
.TexOrigin( 16, 16 ) );
|
||||
|
||||
LeftLegFront = BuildBox( MakeBoxBounds( -4, 0, -6, 0, 6, -2 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 6, -2 ) );
|
||||
.TexOrigin( 0, 16 )
|
||||
.RotOrigin( 0, 6, -2 ) );
|
||||
RightLegFront = BuildBox( MakeBoxBounds( 0, 0, -6, 4, 6, -2 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 6, -2 ) );
|
||||
.TexOrigin( 0, 16 )
|
||||
.RotOrigin( 0, 6, -2 ) );
|
||||
LeftLegBack = BuildBox( MakeBoxBounds( -4, 0, 2, 0, 6, 6 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 6, 2 ) );
|
||||
.TexOrigin( 0, 16 )
|
||||
.RotOrigin( 0, 6, 2 ) );
|
||||
RightLegBack = BuildBox( MakeBoxBounds( 0, 0, 2, 4, 6, 6 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 6, 2 ) );
|
||||
.TexOrigin( 0, 16 )
|
||||
.RotOrigin( 0, 6, 2 ) );
|
||||
}
|
||||
|
||||
public override bool Bobbing { get { return true; } }
|
||||
|
@ -4,51 +4,62 @@ using ClassicalSharp.GraphicsAPI;
|
||||
using OpenTK;
|
||||
|
||||
namespace ClassicalSharp.Model {
|
||||
|
||||
|
||||
public class HumanoidModel : IModel {
|
||||
|
||||
ModelSet Set, SetSlim;
|
||||
ModelSet Set, SetSlim, Set64;
|
||||
public HumanoidModel( Game window ) : base( window ) {
|
||||
vertices = new ModelVertex[boxVertices * ( 7 + 2 )];
|
||||
vertices = new ModelVertex[boxVertices * ( 7 + 11 )];
|
||||
Set = new ModelSet();
|
||||
|
||||
Set.Head = BuildBox( MakeBoxBounds( -4, 24, -4, 4, 32, 4 )
|
||||
.SetTexOrigin( 0, 0 )
|
||||
.SetRotOrigin( 0, 24, 0 ) );
|
||||
Set.Torso = BuildBox( MakeBoxBounds( -4, 12, -2, 4, 24, 2 )
|
||||
.SetTexOrigin( 16, 16 ) );
|
||||
Set.LeftLeg = BuildBox( MakeBoxBounds( 0, 0, -2, -4, 12, 2 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 12, 0 ) );
|
||||
Set.RightLeg = BuildBox( MakeBoxBounds( 0, 0, -2, 4, 12, 2 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 12, 0 ) );
|
||||
Set.Hat = BuildBox( MakeBoxBounds( -4, 24, -4, 4, 32, 4 )
|
||||
.SetTexOrigin( 32, 0 ).ExpandBounds( 0.5f )
|
||||
.SetRotOrigin( 0, 24, 0 ) );
|
||||
Set.LeftArm = BuildBox( MakeBoxBounds( -4, 12, -2, -8, 24, 2 )
|
||||
.SetTexOrigin( 40, 16 )
|
||||
.SetRotOrigin( -5, 22, 0 ) );
|
||||
Set.RightArm = BuildBox( MakeBoxBounds( 4, 12, -2, 8, 24, 2 )
|
||||
.SetTexOrigin( 40, 16 )
|
||||
.SetRotOrigin( 5, 22, 0 ) );
|
||||
BoxDesc head = MakeBoxBounds( -4, 24, -4, 4, 32, 4 ).RotOrigin( 0, 24, 0 );
|
||||
BoxDesc torso = MakeBoxBounds( -4, 12, -2, 4, 24, 2 );
|
||||
BoxDesc lLeg = MakeBoxBounds( -4, 0, -2, 0, 12, 2 ).RotOrigin( 0, 12, 0 );
|
||||
BoxDesc rLeg = MakeBoxBounds( 0, 0, -2, 4, 12, 2 ).RotOrigin( 0, 12, 0 );
|
||||
BoxDesc lArm = MakeBoxBounds( -8, 12, -2, -4, 24, 2 ).RotOrigin( -5, 22, 0 );
|
||||
BoxDesc rArm = MakeBoxBounds( 4, 12, -2, 8, 24, 2 ).RotOrigin( 5, 22, 0 );
|
||||
|
||||
Set.Head = BuildBox( head.TexOrigin( 0, 0 ) );
|
||||
Set.Torso = BuildBox( torso.TexOrigin( 16, 16 ) );
|
||||
Set.LeftLeg = BuildBox( lLeg.MirrorX().TexOrigin( 0, 16 ) );
|
||||
Set.RightLeg = BuildBox( rLeg.TexOrigin( 0, 16 ) );
|
||||
Set.Hat = BuildBox( head.TexOrigin( 32, 0 ).Expand( 0.5f ) );
|
||||
Set.LeftArm = BuildBox( lArm.TexOrigin( 40, 16 ) );
|
||||
Set.RightArm = BuildBox( rArm.TexOrigin( 40, 16 ) );
|
||||
|
||||
Set64 = new ModelSet();
|
||||
Set64.Head = Set.Head;
|
||||
Set64.Torso = Set.Torso;
|
||||
Set64.LeftLeg = BuildBox( lLeg.TexOrigin( 16, 48 ) );
|
||||
Set64.RightLeg = Set.RightLeg;
|
||||
Set64.Hat = Set.Hat;
|
||||
Set64.LeftArm = BuildBox( lLeg.TexOrigin( 32, 48 ) );
|
||||
Set64.RightArm = Set.RightArm;
|
||||
Set64.TorsoLayer = BuildBox( torso.TexOrigin( 16, 32 ).Expand( 0.5f ) );
|
||||
Set64.LeftLegLayer = BuildBox( lLeg.TexOrigin( 0, 48 ).Expand( 0.5f ) );
|
||||
Set64.RightLegLayer = BuildBox( rLeg.TexOrigin( 0, 32 ).Expand( 0.5f ) );
|
||||
Set64.LeftArmLayer = BuildBox( lLeg.TexOrigin( 48, 48 ).Expand( 0.5f ) );
|
||||
Set64.RightArmLayer = BuildBox( rLeg.TexOrigin( 40, 32 ).Expand( 0.5f ) );
|
||||
|
||||
SetSlim = new ModelSet();
|
||||
SetSlim.Head = Set.Head;
|
||||
SetSlim.Torso = Set.Torso;
|
||||
SetSlim.LeftLeg = Set.LeftLeg;
|
||||
SetSlim.LeftLeg = Set64.LeftLeg;
|
||||
SetSlim.RightLeg = Set.RightLeg;
|
||||
SetSlim.LeftArm = BuildBox( MakeBoxBounds( -7, 12, -2, -4, 24, 2 )
|
||||
.SetTexOrigin( 32, 48 )
|
||||
.SetRotOrigin( -5, 22, 0 ) );
|
||||
SetSlim.RightArm = BuildBox( MakeBoxBounds( 4, 12, -2, 7, 24, 2 )
|
||||
.SetTexOrigin( 40, 16 )
|
||||
.SetRotOrigin( 5, 22, 0 ) );
|
||||
SetSlim.Hat = Set.Hat;
|
||||
lArm.BodyW -= 1; lArm.X1 += 1/16f;
|
||||
SetSlim.LeftArm = BuildBox( lArm.TexOrigin( 32, 48 ) );
|
||||
rArm.BodyW -= 1; rArm.X2 -= 1/16f;
|
||||
SetSlim.RightArm = BuildBox( rArm.TexOrigin( 40, 16 ) );
|
||||
SetSlim.TorsoLayer = Set64.TorsoLayer;
|
||||
SetSlim.LeftLegLayer = Set64.LeftLegLayer;
|
||||
SetSlim.RightLegLayer = Set64.RightLegLayer;
|
||||
SetSlim.LeftArmLayer = BuildBox( lArm.Expand( 0.5f ) );
|
||||
SetSlim.RightArmLayer = BuildBox( rArm.Expand( 0.5f ) );
|
||||
}
|
||||
|
||||
public override bool Bobbing { get { return true; } }
|
||||
|
||||
|
||||
public override float NameYOffset { get { return 2.1375f; } }
|
||||
|
||||
public override float GetEyeY( Entity entity ) { return 26/16f; }
|
||||
@ -68,10 +79,11 @@ namespace ClassicalSharp.Model {
|
||||
|
||||
SkinType skinType = p.SkinType;
|
||||
_64x64 = skinType != SkinType.Type64x32;
|
||||
ModelSet model = skinType == SkinType.Type64x64Slim ? SetSlim : Set;
|
||||
ModelSet model = skinType == SkinType.Type64x64Slim ? SetSlim :
|
||||
skinType == SkinType.Type64x64 : Set64 : Set;
|
||||
DrawHeadRotate( -p.PitchRadians, 0, 0, model.Head );
|
||||
|
||||
DrawPart( model.Torso );
|
||||
|
||||
DrawRotate( p.anim.legXRot, 0, 0, model.LeftLeg );
|
||||
DrawRotate( -p.anim.legXRot, 0, 0, model.RightLeg );
|
||||
Rotate = RotateOrder.XZY;
|
||||
@ -82,12 +94,22 @@ namespace ClassicalSharp.Model {
|
||||
|
||||
graphics.AlphaTest = true;
|
||||
index = 0;
|
||||
if( _64x64 ) {
|
||||
DrawPart( model.TorsoLayer );
|
||||
DrawRotate( p.anim.legXRot, 0, 0, model.LeftLegLayer );
|
||||
DrawRotate( -p.anim.legXRot, 0, 0, model.RightLegLayer );
|
||||
Rotate = RotateOrder.XZY;
|
||||
DrawRotate( p.anim.leftXRot, 0, p.anim.leftZRot, model.LeftArmLayer );
|
||||
DrawRotate( p.anim.rightXRot, 0, p.anim.rightZRot, model.RightArmLayer );
|
||||
Rotate = RotateOrder.ZYX;
|
||||
}
|
||||
DrawHeadRotate( -p.PitchRadians, 0, 0, model.Hat );
|
||||
graphics.UpdateDynamicIndexedVb( DrawMode.Triangles, cache.vb, cache.vertices, index, index * 6 / 4 );
|
||||
}
|
||||
|
||||
class ModelSet {
|
||||
public ModelPart Head, Torso, LeftLeg, RightLeg, LeftArm, RightArm, Hat;
|
||||
public ModelPart Head, Torso, LeftLeg, RightLeg, LeftArm, RightArm, Hat,
|
||||
TorsoLayer, LeftLegLayer, RightLegLayer, LeftArmLayer, RightArmLayer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -72,47 +72,59 @@ namespace ClassicalSharp.Model {
|
||||
protected ModelVertex[] vertices;
|
||||
protected int index;
|
||||
|
||||
public struct BoxDescription {
|
||||
public struct BoxDesc {
|
||||
public int TexX, TexY, SidesW, BodyW, BodyH;
|
||||
public float X1, X2, Y1, Y2, Z1, Z2;
|
||||
public float RotX, RotY, RotZ;
|
||||
|
||||
public BoxDescription SetTexOrigin( int x, int y ) {
|
||||
/// <summary> Sets the texture origin for this part within the texture atlas. </summary>
|
||||
public BoxDesc TexOrigin( int x, int y ) {
|
||||
TexX = x; TexY = y; return this;
|
||||
}
|
||||
|
||||
public BoxDescription SetModelBounds( float x1, float y1, float z1, float x2, float y2, float z2 ) {
|
||||
/// <summary> Sets the the two corners of this box, in pixel coordinates. </summary>
|
||||
public BoxDesc SetModelBounds( float x1, float y1, float z1, float x2, float y2, float z2 ) {
|
||||
X1 = x1 / 16f; X2 = x2 / 16f;
|
||||
Y1 = y1 / 16f; Y2 = y2 / 16f;
|
||||
Z1 = z1 / 16f; Z2 = z2 / 16f;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BoxDescription ExpandBounds( float amount ) {
|
||||
/// <summary> Expands the corners of this box outwards by the given amount in pixel unis. </summary>
|
||||
public BoxDesc Expand( float amount ) {
|
||||
X1 -= amount / 16f; X2 += amount / 16f;
|
||||
Y1 -= amount / 16f; Y2 += amount / 16f;
|
||||
Z1 -= amount / 16f; Z2 += amount / 16f;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BoxDescription SetRotOrigin( sbyte x, sbyte y, sbyte z ) {
|
||||
/// <summary> Sets the point that this box is rotated around, in pixel coordinates. </summary>
|
||||
public BoxDesc RotOrigin( sbyte x, sbyte y, sbyte z ) {
|
||||
RotX = x / 16f; RotY = y / 16f; RotZ = z / 16f;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary> Swaps the min and max X around, resulting in the part being drawn mirrored. </summary>
|
||||
public BoxDesc MirrorX() {
|
||||
float temp = X1; X1 = X2; X2 = temp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BoxDesc SetX1( float value ) { X1 = value / 16f; return this; }
|
||||
|
||||
public BoxDesc SetX2( float value ) { X1 = value / 16f; return this; }
|
||||
}
|
||||
|
||||
protected BoxDescription MakeBoxBounds( int x1, int y1, int z1, int x2, int y2, int z2 ) {
|
||||
BoxDescription desc = default( BoxDescription )
|
||||
.SetModelBounds( x1, y1, z1, x2, y2, z2 );
|
||||
protected BoxDesc MakeBoxBounds( int x1, int y1, int z1, int x2, int y2, int z2 ) {
|
||||
BoxDesc desc = default(BoxDesc).SetModelBounds( x1, y1, z1, x2, y2, z2 );
|
||||
desc.SidesW = Math.Abs( z2 - z1 );
|
||||
desc.BodyW = Math.Abs( x2 - x1 );
|
||||
desc.BodyH = Math.Abs( y2 - y1 );
|
||||
return desc;
|
||||
}
|
||||
|
||||
protected BoxDescription MakeRotatedBoxBounds( int x1, int y1, int z1, int x2, int y2, int z2 ) {
|
||||
BoxDescription desc = default( BoxDescription )
|
||||
.SetModelBounds( x1, y1, z1, x2, y2, z2 );
|
||||
protected BoxDesc MakeRotatedBoxBounds( int x1, int y1, int z1, int x2, int y2, int z2 ) {
|
||||
BoxDesc desc = default(BoxDesc).SetModelBounds( x1, y1, z1, x2, y2, z2 );
|
||||
desc.SidesW = Math.Abs( y2 - y1 );
|
||||
desc.BodyW = Math.Abs( x2 - x1 );
|
||||
desc.BodyH = Math.Abs( z2 - z1 );
|
||||
@ -132,7 +144,7 @@ namespace ClassicalSharp.Model {
|
||||
/// ┃H┈┈┈tex┈┈┈┈┈H┃H┈┈tex┈┈┈┈┈H┃H┈┈┈tex┈┈┈┈┈H┃H┈┈┈┈tex┈┈┈H┃ <br/>
|
||||
/// ┃┈┈┈┈┈SW┈┈┈┈┈┃┈┈┈┈┈BW┈┈┈┈┈┃┈┈┈┈┈BW┈┈┈┈┈┈┃┈┈┈┈┈SW┈┈┈┈┃ <br/>
|
||||
/// ┗━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━┛ </summary>
|
||||
protected ModelPart BuildBox( BoxDescription desc ) {
|
||||
protected ModelPart BuildBox( BoxDesc desc ) {
|
||||
int sidesW = desc.SidesW, bodyW = desc.BodyW, bodyH = desc.BodyH;
|
||||
float x1 = desc.X1, y1 = desc.Y1, z1 = desc.Z1;
|
||||
float x2 = desc.X2, y2 = desc.Y2, z2 = desc.Z2;
|
||||
@ -160,7 +172,7 @@ namespace ClassicalSharp.Model {
|
||||
/// ┃H┈┈┈tex┈┈┈┈┈H┃H┈┈tex┈┈┈┈┈H┃H┈┈┈tex┈┈┈┈┈H┃H┈┈┈┈tex┈┈┈H┃ <br/>
|
||||
/// ┃┈┈┈┈┈SW┈┈┈┈┈┃┈┈┈┈┈BW┈┈┈┈┈┃┈┈┈┈┈SW┈┈┈┈┈┈┃┈┈┈┈┈SW┈┈┈┈┃ <br/>
|
||||
/// ┗━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━┻━━━━━━━━━━━━━┛ </summary>
|
||||
protected ModelPart BuildRotatedBox( BoxDescription desc ) {
|
||||
protected ModelPart BuildRotatedBox( BoxDesc desc ) {
|
||||
int sidesW = desc.SidesW, bodyW = desc.BodyW, bodyH = desc.BodyH;
|
||||
float x1 = desc.X1, y1 = desc.Y1, z1 = desc.Z1;
|
||||
float x2 = desc.X2, y2 = desc.Y2, z2 = desc.Z2;
|
||||
|
@ -9,22 +9,22 @@ namespace ClassicalSharp.Model {
|
||||
public PigModel( Game window ) : base( window ) {
|
||||
vertices = new ModelVertex[boxVertices * 6];
|
||||
Head = BuildBox( MakeBoxBounds( -4, 8, -14, 4, 16, -6 )
|
||||
.SetTexOrigin( 0, 0 )
|
||||
.SetRotOrigin( 0, 12, -6 ) );
|
||||
.TexOrigin( 0, 0 )
|
||||
.RotOrigin( 0, 12, -6 ) );
|
||||
Torso = BuildRotatedBox( MakeRotatedBoxBounds( -5, 6, -8, 5, 14, 8 )
|
||||
.SetTexOrigin( 28, 8 ) );
|
||||
.TexOrigin( 28, 8 ) );
|
||||
LeftLegFront = BuildBox( MakeBoxBounds( -5, 0, -7, -1, 6, -3 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 6, -5 ) );
|
||||
.TexOrigin( 0, 16 )
|
||||
.RotOrigin( 0, 6, -5 ) );
|
||||
RightLegFront = BuildBox( MakeBoxBounds( 1, 0, -7, 5, 6, -3 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 6, -5 ) );
|
||||
.TexOrigin( 0, 16 )
|
||||
.RotOrigin( 0, 6, -5 ) );
|
||||
LeftLegBack = BuildBox( MakeBoxBounds( -5, 0, 5, -1, 6, 9 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 6, 7 ) );
|
||||
.TexOrigin( 0, 16 )
|
||||
.RotOrigin( 0, 6, 7 ) );
|
||||
RightLegBack = BuildBox( MakeBoxBounds( 1, 0, 5, 5, 6, 9 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 6, 7 ) );
|
||||
.TexOrigin( 0, 16 )
|
||||
.RotOrigin( 0, 6, 7 ) );
|
||||
}
|
||||
|
||||
public override bool Bobbing { get { return true; } }
|
||||
|
@ -12,45 +12,45 @@ namespace ClassicalSharp.Model {
|
||||
public SheepModel( Game window ) : base( window ) {
|
||||
vertices = new ModelVertex[boxVertices * 6 * ( Fur ? 2 : 1 )];
|
||||
Head = BuildBox( MakeBoxBounds( -3, 16, -14, 3, 22, -6 )
|
||||
.SetTexOrigin( 0, 0 )
|
||||
.SetRotOrigin( 0, 18, -8 ) );
|
||||
.TexOrigin( 0, 0 )
|
||||
.RotOrigin( 0, 18, -8 ) );
|
||||
Torso = BuildRotatedBox( MakeRotatedBoxBounds( -4, 12, -8, 4, 18, 8 )
|
||||
.SetTexOrigin( 28, 8 ) );
|
||||
.TexOrigin( 28, 8 ) );
|
||||
LeftLegFront = BuildBox( MakeBoxBounds( -5, 0, -7, -1, 12, -3 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 12, -5 ) );
|
||||
.TexOrigin( 0, 16 )
|
||||
.RotOrigin( 0, 12, -5 ) );
|
||||
RightLegFront = BuildBox( MakeBoxBounds( 1, 0, -7, 5, 12, -3 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 12, -5 ) );
|
||||
.TexOrigin( 0, 16 )
|
||||
.RotOrigin( 0, 12, -5 ) );
|
||||
LeftLegBack = BuildBox( MakeBoxBounds( -5, 0, 5, -1, 12, 9 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 12, 7 ) );
|
||||
.TexOrigin( 0, 16 )
|
||||
.RotOrigin( 0, 12, 7 ) );
|
||||
RightLegBack = BuildBox( MakeBoxBounds( 1, 0, 5, 5, 12, 9 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 12, 7 ) );
|
||||
.TexOrigin( 0, 16 )
|
||||
.RotOrigin( 0, 12, 7 ) );
|
||||
if( Fur ) MakeFurModel();
|
||||
}
|
||||
|
||||
|
||||
void MakeFurModel() {
|
||||
FurHead = BuildBox( MakeBoxBounds( -3, -3, -3, 3, 3, 3 )
|
||||
.SetTexOrigin( 0, 0 )
|
||||
.TexOrigin( 0, 0 )
|
||||
.SetModelBounds( -3.5f, 15.5f, -12.5f, 3.5f, 22.5f, -5.5f )
|
||||
.SetRotOrigin( 0, 18, -8 ) );
|
||||
.RotOrigin( 0, 18, -8 ) );
|
||||
FurTorso = BuildRotatedBox( MakeRotatedBoxBounds( -4, 12, -8, 4, 18, 8 )
|
||||
.SetTexOrigin( 28, 8 )
|
||||
.TexOrigin( 28, 8 )
|
||||
.SetModelBounds( -6f, 10.5f, -10f, 6f, 19.5f, 10f ) );
|
||||
|
||||
BoxDescription legDesc = MakeBoxBounds( -2, -3, -2, 2, 3, 2 )
|
||||
.SetTexOrigin( 0, 16 );
|
||||
BoxDesc legDesc = MakeBoxBounds( -2, -3, -2, 2, 3, 2 )
|
||||
.TexOrigin( 0, 16 );
|
||||
FurLeftLegFront = BuildBox( legDesc.SetModelBounds( -5.5f, 5.5f, -7.5f, -0.5f, 12.5f, -2.5f )
|
||||
.SetRotOrigin( 0, 12, -5 ) );
|
||||
.RotOrigin( 0, 12, -5 ) );
|
||||
FurRightLegFront = BuildBox( legDesc.SetModelBounds( 0.5f, 5.5f, -7.5f, 5.5f, 12.5f, -2.5f )
|
||||
.SetRotOrigin( 0, 12, -5 ) );
|
||||
.RotOrigin( 0, 12, -5 ) );
|
||||
FurLeftLegBack = BuildBox( legDesc.SetModelBounds( -5.5f, 5.5f, 4.5f, -0.5f, 12.5f, 9.5f )
|
||||
.SetRotOrigin( 0, 12, 7 ) );
|
||||
.RotOrigin( 0, 12, 7 ) );
|
||||
FurRightLegBack = BuildBox( legDesc.SetModelBounds( 0.5f, 5.5f, 4.5f, 5.5f, 12.5f, 9.5f )
|
||||
.SetRotOrigin( 0, 12, 7 ) );
|
||||
.RotOrigin( 0, 12, 7 ) );
|
||||
}
|
||||
|
||||
public override bool Bobbing { get { return true; } }
|
||||
|
@ -9,22 +9,22 @@ namespace ClassicalSharp.Model {
|
||||
public SkeletonModel( Game window ) : base( window ) {
|
||||
vertices = new ModelVertex[boxVertices * 6];
|
||||
Head = BuildBox( MakeBoxBounds( -4, 24, -4, 4, 32, 4 )
|
||||
.SetTexOrigin( 0, 0 )
|
||||
.SetRotOrigin( 0, 24, 0 ) );
|
||||
.TexOrigin( 0, 0 )
|
||||
.RotOrigin( 0, 24, 0 ) );
|
||||
Torso = BuildBox( MakeBoxBounds( -4, 12, -2, 4, 24, 2 )
|
||||
.SetTexOrigin( 16, 16 ) );
|
||||
.TexOrigin( 16, 16 ) );
|
||||
LeftLeg = BuildBox( MakeBoxBounds( -1, 0, -1, -3, 12, 1 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 12, 0 ) );
|
||||
.TexOrigin( 0, 16 )
|
||||
.RotOrigin( 0, 12, 0 ) );
|
||||
RightLeg = BuildBox( MakeBoxBounds( 1, 0, -1, 3, 12, 1 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 12, 0 ) );
|
||||
.TexOrigin( 0, 16 )
|
||||
.RotOrigin( 0, 12, 0 ) );
|
||||
LeftArm = BuildBox( MakeBoxBounds( -4, 12, -1, -6, 24, 1 )
|
||||
.SetTexOrigin( 40, 16 )
|
||||
.SetRotOrigin( -5, 23, 0 ) );
|
||||
.TexOrigin( 40, 16 )
|
||||
.RotOrigin( -5, 23, 0 ) );
|
||||
RightArm = BuildBox( MakeBoxBounds( 4, 12, -1, 6, 24, 1 )
|
||||
.SetTexOrigin( 40, 16 )
|
||||
.SetRotOrigin( 5, 23, 0 ) );
|
||||
.TexOrigin( 40, 16 )
|
||||
.RotOrigin( 5, 23, 0 ) );
|
||||
}
|
||||
|
||||
public override bool Bobbing { get { return true; } }
|
||||
|
@ -9,18 +9,18 @@ namespace ClassicalSharp.Model {
|
||||
public SpiderModel( Game window ) : base( window ) {
|
||||
vertices = new ModelVertex[boxVertices * 5];
|
||||
Head = BuildBox( MakeBoxBounds( -4, 4, -11, 4, 12, -3 )
|
||||
.SetTexOrigin( 32, 4 )
|
||||
.SetRotOrigin( 0, 8, -3 ) );
|
||||
.TexOrigin( 32, 4 )
|
||||
.RotOrigin( 0, 8, -3 ) );
|
||||
Link = BuildBox( MakeBoxBounds( -3, 5, 3, 3, 11, -3 )
|
||||
.SetTexOrigin( 0, 0 ) );
|
||||
.TexOrigin( 0, 0 ) );
|
||||
End = BuildBox( MakeBoxBounds( -5, 4, 3, 5, 12, 15 )
|
||||
.SetTexOrigin( 0, 12 ) );
|
||||
.TexOrigin( 0, 12 ) );
|
||||
LeftLeg = BuildBox( MakeBoxBounds( -19, 7, -1, -3, 9, 1 )
|
||||
.SetTexOrigin( 18, 0 )
|
||||
.SetRotOrigin( -3, 8, 0 ) );
|
||||
.TexOrigin( 18, 0 )
|
||||
.RotOrigin( -3, 8, 0 ) );
|
||||
RightLeg = BuildBox( MakeBoxBounds( 3, 7, -1, 19, 9, 1 )
|
||||
.SetTexOrigin( 18, 0 )
|
||||
.SetRotOrigin( 3, 8, 0 ) );
|
||||
.TexOrigin( 18, 0 )
|
||||
.RotOrigin( 3, 8, 0 ) );
|
||||
}
|
||||
|
||||
public override bool Bobbing { get { return true; } }
|
||||
|
@ -9,22 +9,22 @@ namespace ClassicalSharp.Model {
|
||||
public ZombieModel( Game window ) : base( window ) {
|
||||
vertices = new ModelVertex[boxVertices * 6];
|
||||
Head = BuildBox( MakeBoxBounds( -4, 24, -4, 4, 32, 4 )
|
||||
.SetTexOrigin( 0, 0 )
|
||||
.SetRotOrigin( 0, 24, 0 ) );
|
||||
.TexOrigin( 0, 0 )
|
||||
.RotOrigin( 0, 24, 0 ) );
|
||||
Torso = BuildBox( MakeBoxBounds( -4, 12, -2, 4, 24, 2 )
|
||||
.SetTexOrigin( 16, 16 ) );
|
||||
.TexOrigin( 16, 16 ) );
|
||||
LeftLeg = BuildBox( MakeBoxBounds( 0, 0, -2, -4, 12, 2 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 12, 0 ) );
|
||||
.TexOrigin( 0, 16 )
|
||||
.RotOrigin( 0, 12, 0 ) );
|
||||
RightLeg = BuildBox( MakeBoxBounds( 0, 0, -2, 4, 12, 2 )
|
||||
.SetTexOrigin( 0, 16 )
|
||||
.SetRotOrigin( 0, 12, 0 ) );
|
||||
.TexOrigin( 0, 16 )
|
||||
.RotOrigin( 0, 12, 0 ) );
|
||||
LeftArm = BuildBox( MakeBoxBounds( -4, 12, -2, -8, 24, 2 )
|
||||
.SetTexOrigin( 40, 16 )
|
||||
.SetRotOrigin( -6, 22, 0 ) );
|
||||
.TexOrigin( 40, 16 )
|
||||
.RotOrigin( -6, 22, 0 ) );
|
||||
RightArm = BuildBox( MakeBoxBounds( 4, 12, -2, 8, 24, 2 )
|
||||
.SetTexOrigin( 40, 16 )
|
||||
.SetRotOrigin( 6, 22, 0 ) );
|
||||
.TexOrigin( 40, 16 )
|
||||
.RotOrigin( 6, 22, 0 ) );
|
||||
}
|
||||
|
||||
public override bool Bobbing { get { return true; } }
|
||||
|
@ -25,7 +25,6 @@ namespace ClassicalSharp {
|
||||
Utils.LogDebug( "default.zip not found. Cannot start." );
|
||||
return;
|
||||
}
|
||||
Console.BufferHeight = short.MaxValue - 10;
|
||||
|
||||
bool nullContext = true;
|
||||
#if !USE_DX
|
||||
|
Loading…
x
Reference in New Issue
Block a user