Skip to content

Commit

Permalink
Make some IModel fields static
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Aug 18, 2017
1 parent 32e24eb commit d3fbfb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 0 additions & 6 deletions ClassicalSharp/Entities/Model/HumanModels.cs
Expand Up @@ -97,9 +97,6 @@ public class HumanoidHeadModel : HumanoidModel {

protected override void RenderParts(Entity p) {
HumanoidModel human = (HumanoidModel)game.ModelCache.Models[0].Instance;
human.cols = cols;
human.cosHead = cosHead; human.sinHead = sinHead;
human.uScale = uScale; human.vScale = vScale;
vertices = human.vertices;

DrawRotate(-p.HeadXRadians, 0, 0, human.Set.Head, true);
Expand Down Expand Up @@ -137,9 +134,6 @@ public class ArmModel : HumanoidModel {

protected override void RenderParts(Entity p) {
HumanoidModel human = (HumanoidModel)game.ModelCache.Models[0].Instance;
human.cols = cols;
human.cosHead = cosHead; human.sinHead = sinHead;
human.uScale = uScale; human.vScale = vScale;
vertices = human.vertices;

SkinType skinType = p.SkinType;
Expand Down
6 changes: 3 additions & 3 deletions ClassicalSharp/Entities/Model/IModel.cs
Expand Up @@ -74,8 +74,9 @@ public abstract class IModel {
/// assuming that the model is not rotated at all.</summary>
public abstract AABB PickingBounds { get; }

protected internal float cosHead, sinHead;
protected internal float uScale, vScale;
protected static float cosHead, sinHead;
protected static float uScale, vScale;
protected static int[] cols = new int[6];

/// <summary> Returns whether the model should be rendered based on the given entity's position. </summary>
public static bool ShouldRender(Entity p, FrustumCulling culling) {
Expand Down Expand Up @@ -158,7 +159,6 @@ public abstract class IModel {
return p.TransformMatrix(p.ModelScale, pos);
}

protected internal int[] cols = new int[6];
protected internal ModelVertex[] vertices;
protected internal int index, texIndex;

Expand Down

0 comments on commit d3fbfb1

Please sign in to comment.