Beispiel #1
0
		public Vec3 Closest(Vec3 to)
			=> NativeAPI.plane_point_closest(this, to);
Beispiel #2
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr mesh_gen_rounded_cube(Vec3 dimensions, float edge_radius, int subdivisions);
Beispiel #3
0
 /// <summary>Basic initialization constructor! Just copies in the provided values directly.</summary>
 /// <param name="x">X location of the pose.</param>
 /// <param name="y">Y location of the pose.</param>
 /// <param name="z">Z location of the pose.</param>
 /// <param name="orientation">Orientation of the pose, stored as a rotation from Vec3.Forward.</param>
 public Pose(float x, float y, float z, Quat orientation)
 {
     this.position    = new Vec3(x, y, z);
     this.orientation = orientation;
 }
Beispiel #4
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern Quat quat_euler(Vec3 euler_degrees);
Beispiel #5
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern Vec3 quat_mul_vec(ref Quat a, ref Vec3 b);
Beispiel #6
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern void   solid_teleport(IntPtr solid, ref Vec3 position, ref Quat rotation);
Beispiel #7
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern void render_set_light(ref Vec3 direction, float intensity, ref Color color);
Beispiel #8
0
 public bool Intersect(Ray ray, out Vec3 at)
 => NativeAPI.bounds_ray_intersect(this, ray, out at);
Beispiel #9
0
 public bool Contains(Vec3 pt)
 => NativeAPI.bounds_point_contains(this, pt);
Beispiel #10
0
 /// <summary>Create a bounding box from a corner, plus box dimensions.</summary>
 /// <param name="bottomLeftBack">The -X,-Y,-Z corner of the box.</param>
 /// <param name="dimensions">The total dimensions of the box.</param>
 /// <returns>A Bounds object that extends from bottomLeftBack to bottomLeftBack+dimensions.</returns>
 public static Bounds FromCorner(Vec3 bottomLeftBack, Vec3 dimensions)
 => new Bounds(bottomLeftBack + dimensions / 2, dimensions);
Beispiel #11
0
 /// <summary>Create a bounding box between two corner points.</summary>
 /// <param name="bottomLeftBack">The -X,-Y,-Z corner of the box.</param>
 /// <param name="topRightFront">The +X,+Y,+Z corner of the box.</param>
 /// <returns>A Bounds object that extends from bottomLeftBack to topRightFront.</returns>
 public static Bounds FromCorners(Vec3 bottomLeftBack, Vec3 topRightFront)
 => new Bounds(bottomLeftBack / 2 + topRightFront / 2, topRightFront - bottomLeftBack);
Beispiel #12
0
 /// <summary>Creates a bounding box object centered around zero!</summary>
 /// <param name="totalDimensions">The total size of the box, from one end to the
 /// other. This is the width, height, and depth of the Bounds.</param>
 public Bounds(Vec3 totalDimensions)
 {
     this.center = Vec3.Zero;
     dimensions  = totalDimensions;
 }
Beispiel #13
0
 /// <summary>Creates a bounding box object!</summary>
 /// <param name="center">The exact center of the box.</param>
 /// <param name="totalDimensions">The total size of the box, from one end to the
 /// other. This is the width, height, and depth of the Bounds.</param>
 public Bounds(Vec3 center, Vec3 totalDimensions)
 {
     this.center = center;
     dimensions  = totalDimensions;
 }
Beispiel #14
0
 public HandJoint(Vec3 position, Quat orientation, float radius)
 {
     this.position    = position;
     this.orientation = orientation;
     this.radius      = radius;
 }
Beispiel #15
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern void   solid_add_box(IntPtr solid, ref Vec3 dimensions, float kilograms, ref Vec3 offset);
Beispiel #16
0
 public bool Contains(Vec3 linePt1, Vec3 linePt2)
 => NativeAPI.bounds_line_contains(this, linePt1, linePt2);
Beispiel #17
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern void   solid_add_capsule(IntPtr solid, float diameter, float height, float kilograms, ref Vec3 offset);
Beispiel #18
0
 /// <summary>Does the bounds contain or intersect with the given
 /// capsule?</summary>
 /// <param name="linePt1">Start of the capsule.</param>
 /// <param name="linePt2">End of the capsule</param>
 /// <param name="radius">Radius of the capsule.</param>
 /// <returns>True if the capsule is in, or intersects with the
 /// bounds.</returns>
 public bool Contains(Vec3 linePt1, Vec3 linePt2, float radius)
 => NativeAPI.bounds_capsule_contains(this, linePt1, linePt2, radius);
Beispiel #19
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern void   solid_set_velocity_ang(IntPtr solid, ref Vec3 radians_per_second);
Beispiel #20
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern void transform_set(IntPtr transform, ref Vec3 position, ref Vec3 scale, ref Quat rotation);
Beispiel #21
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern Quat quat_lookat(Vec3 from, Vec3 at);
Beispiel #22
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern void transform_lookat(IntPtr transform, ref Vec3 at);
Beispiel #23
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern int  ui_affordance(string text, ref Pose movement, Vec3 at, Vec3 size);
Beispiel #24
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern Vec3   transform_world_to_local(IntPtr transform, ref Vec3 world_coordinate);
Beispiel #25
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr mesh_gen_cube(Vec3 dimensions, int subdivisions = 0);
Beispiel #26
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern Vec3   transform_local_to_world_dir(IntPtr transform, ref Vec3 local_direction);
Beispiel #27
0
 /// <summary>Basic initialization constructor! Just copies in the provided values directly.</summary>
 /// <param name="position">Location of the pose.</param>
 /// <param name="orientation">Orientation of the pose, stored as a rotation from Vec3.Forward.</param>
 public Pose(Vec3 position, Quat orientation)
 {
     this.position    = position;
     this.orientation = orientation;
 }
Beispiel #28
0
 [DllImport(NativeLib.DllName, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr solid_create(ref Vec3 position, ref Quat rotation, SolidType type = SolidType.Normal);
Beispiel #29
0
 public Matrix ToMatrix(Vec3 scale) => NativeAPI.pose_matrix(this, scale);
Beispiel #30
0
		public bool Intersect(Vec3 lineStart, Vec3 lineEnd, out Vec3 at)
			=> NativeAPI.plane_line_intersect(this, lineStart, lineEnd, out at);