| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- /*
- * Copyright (c) 2012-2015 Daniele Bartolini and individual contributors.
- * License: https://github.com/taylor001/crown/blob/master/LICENSE
- */
- using System;
- namespace Crown
- {
- public struct Vector3
- {
- public Vector3(float x, float y, float z)
- {
- this.x = x;
- this.y = y;
- this.z = z;
- }
- public static Vector3 operator+(Vector3 a, Vector3 b)
- {
- return new Vector3(a.x + b.x, a.y + b.y, a.z + b.z);
- }
- public static Vector3 operator-(Vector3 a, Vector3 b)
- {
- return new Vector3(a.x - b.x, a.y - b.y, a.z - b.z);
- }
- public static Vector3 operator*(Vector3 a, float k)
- {
- return new Vector3(a.x * k, a.y * k, a.z * k);
- }
- public static Vector3 operator*(float k, Vector3 a)
- {
- return a * k;
- }
- public float x, y, z;
- }
- }
|