aboutsummaryrefslogtreecommitdiff
path: root/src/models.c
diff options
context:
space:
mode:
authorJoshua Reisenauer <kd7tck@msn.com>2016-05-30 15:39:21 -0700
committerJoshua Reisenauer <kd7tck@msn.com>2016-05-30 15:39:21 -0700
commit6ad832386097d6301555490e94cf9cc2c882137d (patch)
tree2f18bcb487aabe5b3b6073f88078a986328fbec2 /src/models.c
parent9f2fc81df2ad6731b521bd7dfd523ee10f63be90 (diff)
parent8a4e28f81db16c034274e5d78dddfe33824e59fe (diff)
downloadraylib-6ad832386097d6301555490e94cf9cc2c882137d.tar.gz
raylib-6ad832386097d6301555490e94cf9cc2c882137d.zip
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
Diffstat (limited to 'src/models.c')
-rw-r--r--src/models.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/models.c b/src/models.c
index 07dee720..092a43fc 100644
--- a/src/models.c
+++ b/src/models.c
@@ -75,6 +75,25 @@ void Draw3DLine(Vector3 startPos, Vector3 endPos, Color color)
rlEnd();
}
+// Draw a circle in 3D world space
+void Draw3DCircle(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color)
+{
+ rlPushMatrix();
+ rlTranslatef(center.x, center.y, center.z);
+ rlRotatef(rotationAngle, rotation.x, rotation.y, rotation.z);
+
+ rlBegin(RL_LINES);
+ for (int i = 0; i < 360; i += 10)
+ {
+ rlColor4ub(color.r, color.g, color.b, color.a);
+
+ rlVertex3f(sin(DEG2RAD*i)*radius, cos(DEG2RAD*i)*radius, 0.0f);
+ rlVertex3f(sin(DEG2RAD*(i + 10)) * radius, cos(DEG2RAD*(i + 10)) * radius, 0.0f);
+ }
+ rlEnd();
+ rlPopMatrix();
+}
+
// Draw cube
// NOTE: Cube position is the center position
void DrawCube(Vector3 position, float width, float height, float length, Color color)
@@ -732,12 +751,12 @@ Material LoadDefaultMaterial(void)
//material.texNormal; // NOTE: By default, not set
//material.texSpecular; // NOTE: By default, not set
+ material.colTint = WHITE; // Tint color
material.colDiffuse = WHITE; // Diffuse color
material.colAmbient = WHITE; // Ambient color
material.colSpecular = WHITE; // Specular color
material.glossiness = 100.0f; // Glossiness level
- material.normalDepth = 1.0f; // Normal map depth
return material;
}
@@ -1250,7 +1269,7 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota
//Matrix matModel = MatrixMultiply(model.transform, matTransform); // Transform to world-space coordinates
model.transform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation);
- // model.material.colDiffuse = tint;
+ model.material.colTint = tint;
rlglDrawMesh(model.mesh, model.material, model.transform);
}