mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-16 11:06:06 -04:00
Make Chibi's model more consistent with the other models, also make set its name height to be just above the head.
This commit is contained in:
parent
40878872bf
commit
04ade22693
@ -6,29 +6,33 @@ namespace ClassicalSharp.Model {
|
|||||||
|
|
||||||
public class ChibiModel : IModel {
|
public class ChibiModel : IModel {
|
||||||
|
|
||||||
ModelSet Set, SetSlim;
|
|
||||||
public ChibiModel( Game window ) : base( window ) {
|
public ChibiModel( Game window ) : base( window ) {
|
||||||
vertices = new ModelVertex[boxVertices * (7 + 2)];
|
vertices = new ModelVertex[boxVertices * (7 + 2)];
|
||||||
Set = new ModelSet();
|
|
||||||
|
|
||||||
Set.Head = EasyBox(8, 8, 8, 8f, 8f, 8f, 0, 0, 0, 16, 0);
|
Head = BuildBox( MakeBoxBounds( -4, 12, -4, 4, 20, 4 )
|
||||||
Set.Hat = EasyBox(8, 8, 8, 8.5f, 8.5f, 8.5f, 32, 0, 0, 16, 0);
|
.SetTexOrigin( 0, 0 ) );
|
||||||
|
Hat = BuildBox( MakeBoxBounds( -4, 12, -4, 4, 20, 4 )
|
||||||
Set.Torso = EasyBox(8, 12, 4, 4f, 6f, 2f, 16, 16, 0, 9, 0);
|
.SetTexOrigin( 32, 0 ).ExpandBounds( 0.25f ) );
|
||||||
|
Torso = BuildBox( MakeBoxBounds( -4, -6, -2, 4, 6, 2 )
|
||||||
Set.LeftLeg = EasyBox(4, 12, 4, -2f, 6f, 2f, 0, 16, -1, 3, 0);
|
.SetTexOrigin( 16, 16 )
|
||||||
|
.SetModelBounds( -2, 6, -1, 2, 12, 1 ) );
|
||||||
Set.RightLeg = EasyBox(4, 12, 4, 2f, 6f, 2f, 0, 16, 1, 3, 0);
|
LeftLeg = BuildBox( MakeBoxBounds( -2, -6, -2, 2, 6, 2 )
|
||||||
|
.SetTexOrigin( 0, 16 )
|
||||||
|
.SetModelBounds( -0, 0, -1, -2, 6, 1 ) );
|
||||||
Set.LeftArm = EasyBox(4, 12, 4, -2f, 6f, 2f, 40, 16, -3, 9, 0);
|
RightLeg = BuildBox( MakeBoxBounds( -2, -6, -2, 2, 6, 2 )
|
||||||
|
.SetTexOrigin( 0, 16 )
|
||||||
Set.RightArm = EasyBox(4, 12, 4, 2f, 6f, 2f, 40, 16, 3, 9, 0);
|
.SetModelBounds( 0, 0, -1, 2, 6, 1 ) );
|
||||||
|
LeftArm = BuildBox( MakeBoxBounds( -2, -6, -2, 2, 6, 2 )
|
||||||
|
.SetTexOrigin( 40, 16 )
|
||||||
|
.SetModelBounds( -2, 6, -1, -4, 12, 1 ) );
|
||||||
|
RightArm = BuildBox( MakeBoxBounds( -2, -6, -2, 2, 6, 2 )
|
||||||
|
.SetTexOrigin( 40, 16 )
|
||||||
|
.SetModelBounds( 2, 6, -1, 4, 12, 1 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Bobbing { get { return true; } }
|
public override bool Bobbing { get { return true; } }
|
||||||
|
|
||||||
public override float NameYOffset { get { return 2.1375f; } }
|
public override float NameYOffset { get { return 1.3875f; } }
|
||||||
|
|
||||||
public override float GetEyeY( Entity entity ) { return 14/16f; }
|
public override float GetEyeY( Entity entity ) { return 14/16f; }
|
||||||
|
|
||||||
@ -47,38 +51,23 @@ namespace ClassicalSharp.Model {
|
|||||||
|
|
||||||
SkinType skinType = p.SkinType;
|
SkinType skinType = p.SkinType;
|
||||||
_64x64 = skinType != SkinType.Type64x32;
|
_64x64 = skinType != SkinType.Type64x32;
|
||||||
DrawHeadRotate( 0, 13/16f, 0, -p.PitchRadians, 0, 0, Set.Head );
|
DrawHeadRotate( 0, 13/16f, 0, -p.PitchRadians, 0, 0, Head );
|
||||||
|
|
||||||
DrawPart( Set.Torso );
|
DrawPart( Torso );
|
||||||
DrawRotate( 0, 6/16f, 0, p.anim.legXRot, 0, 0, Set.LeftLeg );
|
DrawRotate( 0, 6/16f, 0, p.anim.legXRot, 0, 0, LeftLeg );
|
||||||
DrawRotate( 0, 6/16f, 0, -p.anim.legXRot, 0, 0, Set.RightLeg );
|
DrawRotate( 0, 6/16f, 0, -p.anim.legXRot, 0, 0, RightLeg );
|
||||||
Rotate = RotateOrder.XZY;
|
Rotate = RotateOrder.XZY;
|
||||||
|
DrawRotate( -3/16f, 11/16f, 0, p.anim.leftXRot, 0, p.anim.leftZRot, LeftArm );
|
||||||
DrawRotate( -3/16f, 11/16f, 0, p.anim.leftXRot, 0, p.anim.leftZRot, Set.LeftArm );
|
DrawRotate( 3/16f, 11/16f, 0, p.anim.rightXRot, 0, p.anim.rightZRot, RightArm );
|
||||||
DrawRotate( 3/16f, 11/16f, 0, p.anim.rightXRot, 0, p.anim.rightZRot, Set.RightArm );
|
|
||||||
Rotate = RotateOrder.ZYX;
|
Rotate = RotateOrder.ZYX;
|
||||||
|
|
||||||
graphics.UpdateDynamicIndexedVb( DrawMode.Triangles, cache.vb, cache.vertices, index, index * 6 / 4 );
|
graphics.UpdateDynamicIndexedVb( DrawMode.Triangles, cache.vb, cache.vertices, index, index * 6 / 4 );
|
||||||
|
|
||||||
graphics.AlphaTest = true;
|
graphics.AlphaTest = true;
|
||||||
index = 0;
|
index = 0;
|
||||||
DrawHeadRotate( 0, 13f/16f, 0, -p.PitchRadians, 0, 0, Set.Hat );
|
DrawHeadRotate( 0, 13f/16f, 0, -p.PitchRadians, 0, 0, Hat );
|
||||||
graphics.UpdateDynamicIndexedVb( DrawMode.Triangles, cache.vb, cache.vertices, index, index * 6 / 4 );
|
graphics.UpdateDynamicIndexedVb( DrawMode.Triangles, cache.vb, cache.vertices, index, index * 6 / 4 );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ModelPart EasyBox( int xSize, int ySize, int zSize, float xResize, float yResize, float zResize,
|
ModelPart Head, Torso, LeftLeg, RightLeg, LeftArm, RightArm, Hat;
|
||||||
int u, int v, int xOff = 0, int yOff = 0, int zOff = 0 ) {
|
|
||||||
return BuildBox(
|
|
||||||
MakeBoxBounds( (int)(-xSize * 0.5f + xOff), (int)(-ySize * 0.5f + yOff), (int)(-zSize * 0.5f + zOff),
|
|
||||||
(int)(xSize * 0.5f + xOff), (int)(ySize * 0.5f + yOff), (int)(zSize * 0.5f + zOff) )
|
|
||||||
.SetTexOrigin( u, v )
|
|
||||||
.SetModelBounds( -xResize * 0.5f + xOff, -yResize * 0.5f + yOff, -zResize * 0.5f + zOff,
|
|
||||||
xResize * 0.5f + xOff, yResize * 0.5f + yOff, zResize * 0.5f + zOff )
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
class ModelSet {
|
|
||||||
public ModelPart Head, Torso, LeftLeg, RightLeg, LeftArm, RightArm, Hat;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,13 @@ namespace ClassicalSharp.Model {
|
|||||||
Z1 = z1 / 16f; Z2 = z2 / 16f;
|
Z1 = z1 / 16f; Z2 = z2 / 16f;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BoxDescription ExpandBounds( float amount ) {
|
||||||
|
X1 -= amount / 16f; X2 += amount / 16f;
|
||||||
|
Y1 -= amount / 16f; Y2 += amount / 16f;
|
||||||
|
Z1 -= amount / 16f; Z2 += amount / 16f;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected BoxDescription MakeBoxBounds( int x1, int y1, int z1, int x2, int y2, int z2 ) {
|
protected BoxDescription MakeBoxBounds( int x1, int y1, int z1, int x2, int y2, int z2 ) {
|
||||||
|
@ -21,8 +21,7 @@ namespace ClassicalSharp.Model {
|
|||||||
Set.RightLeg = BuildBox( MakeBoxBounds( 0, 0, -2, 4, 12, 2 ).
|
Set.RightLeg = BuildBox( MakeBoxBounds( 0, 0, -2, 4, 12, 2 ).
|
||||||
SetTexOrigin( 0, 16 ) );
|
SetTexOrigin( 0, 16 ) );
|
||||||
Set.Hat = BuildBox( MakeBoxBounds( -4, 24, -4, 4, 32, 4 )
|
Set.Hat = BuildBox( MakeBoxBounds( -4, 24, -4, 4, 32, 4 )
|
||||||
.SetTexOrigin( 32, 0 )
|
.SetTexOrigin( 32, 0 ).ExpandBounds( 0.5f ) );
|
||||||
.SetModelBounds( -4.5f, 23.5f, -4.5f, 4.5f, 32.5f, 4.5f ) );
|
|
||||||
Set.LeftArm = BuildBox( MakeBoxBounds( -4, 12, -2, -8, 24, 2 )
|
Set.LeftArm = BuildBox( MakeBoxBounds( -4, 12, -2, -8, 24, 2 )
|
||||||
.SetTexOrigin( 40, 16 ) );
|
.SetTexOrigin( 40, 16 ) );
|
||||||
Set.RightArm = BuildBox( MakeBoxBounds( 4, 12, -2, 8, 24, 2 )
|
Set.RightArm = BuildBox( MakeBoxBounds( 4, 12, -2, 8, 24, 2 )
|
||||||
|
@ -23,8 +23,7 @@ namespace ClassicalSharp.Model {
|
|||||||
.SetTexOrigin( 0, 16 ) );
|
.SetTexOrigin( 0, 16 ) );
|
||||||
RightLegBack = BuildBox( MakeBoxBounds( 1, 0, 5, 5, 12, 9 )
|
RightLegBack = BuildBox( MakeBoxBounds( 1, 0, 5, 5, 12, 9 )
|
||||||
.SetTexOrigin( 0, 16 ) );
|
.SetTexOrigin( 0, 16 ) );
|
||||||
if( Fur )
|
if( Fur ) MakeFurModel();
|
||||||
MakeFurModel();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -35,9 +34,9 @@ namespace ClassicalSharp.Model {
|
|||||||
FurTorso = BuildRotatedBox( MakeRotatedBoxBounds( -4, 12, -8, 4, 18, 8 )
|
FurTorso = BuildRotatedBox( MakeRotatedBoxBounds( -4, 12, -8, 4, 18, 8 )
|
||||||
.SetTexOrigin( 28, 8 )
|
.SetTexOrigin( 28, 8 )
|
||||||
.SetModelBounds( -6f, 10.5f, -10f, 6f, 19.5f, 10f ) );
|
.SetModelBounds( -6f, 10.5f, -10f, 6f, 19.5f, 10f ) );
|
||||||
|
|
||||||
BoxDescription legDesc = MakeBoxBounds( -2, -3, -2, 2, 3, 2 )
|
BoxDescription legDesc = MakeBoxBounds( -2, -3, -2, 2, 3, 2 )
|
||||||
.SetTexOrigin( 0, 16 );
|
.SetTexOrigin( 0, 16 );
|
||||||
|
|
||||||
FurLeftLegFront = BuildBox( legDesc.SetModelBounds( -5.5f, 5.5f, -7.5f, -0.5f, 12.5f, -2.5f ) );
|
FurLeftLegFront = BuildBox( legDesc.SetModelBounds( -5.5f, 5.5f, -7.5f, -0.5f, 12.5f, -2.5f ) );
|
||||||
FurRightLegFront = BuildBox( legDesc.SetModelBounds( 0.5f, 5.5f, -7.5f, 5.5f, 12.5f, -2.5f ) );
|
FurRightLegFront = BuildBox( legDesc.SetModelBounds( 0.5f, 5.5f, -7.5f, 5.5f, 12.5f, -2.5f ) );
|
||||||
FurLeftLegBack = BuildBox( legDesc.SetModelBounds( -5.5f, 5.5f, 4.5f, -0.5f, 12.5f, 9.5f ) );
|
FurLeftLegBack = BuildBox( legDesc.SetModelBounds( -5.5f, 5.5f, 4.5f, -0.5f, 12.5f, 9.5f ) );
|
||||||
|
@ -272,14 +272,15 @@ namespace ClassicalSharp {
|
|||||||
oldPlayer.Despawn();
|
oldPlayer.Despawn();
|
||||||
}
|
}
|
||||||
game.Players[entityId] = new NetPlayer( displayName, skinName, game, entityId );
|
game.Players[entityId] = new NetPlayer( displayName, skinName, game, entityId );
|
||||||
string identifier = game.Players[entityId].SkinIdentifier;
|
|
||||||
game.EntityEvents.RaiseEntityAdded( entityId );
|
game.EntityEvents.RaiseEntityAdded( entityId );
|
||||||
game.AsyncDownloader.DownloadSkin( identifier, skinName );
|
|
||||||
} else {
|
} else {
|
||||||
game.LocalPlayer.SkinName = skinName;
|
game.LocalPlayer.SkinName = skinName;
|
||||||
game.AsyncDownloader.DownloadSkin( "skin_255", skinName );
|
|
||||||
}
|
}
|
||||||
if( readPosition ) {
|
|
||||||
|
string identifier = game.Players[entityId].SkinIdentifier;
|
||||||
|
game.AsyncDownloader.DownloadSkin( identifier, skinName );
|
||||||
|
if( !readPosition ) return;
|
||||||
|
|
||||||
ReadAbsoluteLocation( entityId, false );
|
ReadAbsoluteLocation( entityId, false );
|
||||||
if( entityId == 0xFF ) {
|
if( entityId == 0xFF ) {
|
||||||
LocalPlayer p = game.LocalPlayer;
|
LocalPlayer p = game.LocalPlayer;
|
||||||
@ -288,7 +289,6 @@ namespace ClassicalSharp {
|
|||||||
p.SpawnPitch = p.PitchDegrees;
|
p.SpawnPitch = p.PitchDegrees;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void RemoveEntity( byte entityId ) {
|
void RemoveEntity( byte entityId ) {
|
||||||
Player player = game.Players[entityId];
|
Player player = game.Players[entityId];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user