Table of Contents

Class RotatedCuboidd

Namespace
Vintagestory.API.MathTools
Assembly
VintagestoryAPI.dll
public class RotatedCuboidd : Cuboidd, IEquatable<Cuboidd>, IRotatedCuboid<double, RotatedCuboidd>, IEquatable<RotatedCuboidd>
Inheritance
RotatedCuboidd
Implements
Inherited Members
Extension Methods

Constructors

RotatedCuboidd()

public RotatedCuboidd()

RotatedCuboidd(double, double, double, double, double, double)

public RotatedCuboidd(double x1, double y1, double z1, double x2, double y2, double z2)

Parameters

x1 double
y1 double
z1 double
x2 double
y2 double
z2 double

RotatedCuboidd(Cuboidd)

public RotatedCuboidd(Cuboidd cuboid)

Parameters

cuboid Cuboidd

RotatedCuboidd(Cuboidd, Vec3d)

public RotatedCuboidd(Cuboidd cuboid, Vec3d rotationCenter)

Parameters

cuboid Cuboidd
rotationCenter Vec3d

RotatedCuboidd(Cuboidd, Vec3d, double[])

public RotatedCuboidd(Cuboidd cuboid, Vec3d rotationCenter, double[] quaternion)

Parameters

cuboid Cuboidd
rotationCenter Vec3d
quaternion double[]

RotatedCuboidd(RotatedCuboidf, double, double, double)

public RotatedCuboidd(RotatedCuboidf source, double offsetX, double offsetY, double offsetZ)

Parameters

source RotatedCuboidf
offsetX double
offsetY double
offsetZ double

Properties

RotationCenterDouble

public Vec3d RotationCenterDouble { get; }

Property Value

Vec3d

Methods

Clone()

Creates a copy of the cuboid

public override RotatedCuboidd Clone()

Returns

RotatedCuboidd

Contains(double, double, double)

public bool Contains(double x, double y, double z)

Parameters

x double
y double
z double

Returns

bool

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Equals(RotatedCuboidd?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(RotatedCuboidd? other)

Parameters

other RotatedCuboidd

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetAABB()

public Cuboidd GetAABB()

Returns

Cuboidd

GetAABB(Cuboidd)

Writes the world-space axis-aligned bounds of this cuboid into the supplied result.

public Cuboidd GetAABB(Cuboidd result)

Parameters

result Cuboidd

Returns

Cuboidd

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetRotationMatrix()

public double[] GetRotationMatrix()

Returns

double[]

GetRotationQuaternion()

public double[] GetRotationQuaternion()

Returns

double[]

Intersects(Cuboidd)

If the given cuboid intersects with this cuboid

public override bool Intersects(Cuboidd other)

Parameters

other Cuboidd

Returns

bool

Intersects(Cuboidd, Vec3d)

public bool Intersects(Cuboidd other, Vec3d off)

Parameters

other Cuboidd
off Vec3d

Returns

bool

Intersects(Cuboidf)

If the given cuboid intersects with this cuboid

public override bool Intersects(Cuboidf other)

Parameters

other Cuboidf

Returns

bool

Intersects(Cuboidf, double, double, double)

public override bool Intersects(Cuboidf other, double offsetx, double offsety, double offsetz)

Parameters

other Cuboidf
offsetx double
offsety double
offsetz double

Returns

bool

Intersects(Cuboidf, Vec3d)

If the given cuboid intersects with this cuboid

public override bool Intersects(Cuboidf other, Vec3d off)

Parameters

other Cuboidf
off Vec3d

Returns

bool

IntersectsOrTouches(Cuboidd)

If the given cuboid intersects with this cuboid

public override bool IntersectsOrTouches(Cuboidd other)

Parameters

other Cuboidd

Returns

bool

IntersectsOrTouches(Cuboidd, Vec3d)

public bool IntersectsOrTouches(Cuboidd other, Vec3d off)

Parameters

other Cuboidd
off Vec3d

Returns

bool

IntersectsOrTouches(Cuboidf, double, double, double)

If the given cuboid intersects with this cuboid

public override bool IntersectsOrTouches(Cuboidf other, double offsetX, double offsetY, double offsetZ)

Parameters

other Cuboidf
offsetX double
offsetY double
offsetZ double

Returns

bool

IntersectsOrTouches(Cuboidf, Vec3d)

If the given cuboid intersects with this cuboid

public override bool IntersectsOrTouches(Cuboidf other, Vec3d off)

Parameters

other Cuboidf
off Vec3d

Returns

bool

IsRotated()

public override bool IsRotated()

Returns

bool

OffsetCopy(double, double, double)

public RotatedCuboidd OffsetCopy(double x, double y, double z)

Parameters

x double
y double
z double

Returns

RotatedCuboidd

OffsetCopy(IVec3)

public RotatedCuboidd OffsetCopy(IVec3 vec)

Parameters

vec IVec3

Returns

RotatedCuboidd

Set(double, double, double, double, double, double)

public RotatedCuboidd Set(double x1, double y1, double z1, double x2, double y2, double z2)

Parameters

x1 double
y1 double
z1 double
x2 double
y2 double
z2 double

Returns

RotatedCuboidd

Set(double, double, double, double, double, double, Vec3d, double[])

Copies the supplied bounds and rotation into this cuboid while retaining its reusable collision state.

public RotatedCuboidd Set(double x1, double y1, double z1, double x2, double y2, double z2, Vec3d rotationCenter, double[] quaternion)

Parameters

x1 double
y1 double
z1 double
x2 double
y2 double
z2 double
rotationCenter Vec3d
quaternion double[]

Returns

RotatedCuboidd

SetRotationCenter(Vec3d)

public RotatedCuboidd SetRotationCenter(Vec3d center)

Parameters

center Vec3d

Returns

RotatedCuboidd

SetRotationEuler(double, double, double)

public RotatedCuboidd SetRotationEuler(double degX, double degY, double degZ)

Parameters

degX double
degY double
degZ double

Returns

RotatedCuboidd

SetRotationQuaternion(double[])

public RotatedCuboidd SetRotationQuaternion(double[] quaternion)

Parameters

quaternion double[]

Returns

RotatedCuboidd

pushOutX(Cuboidd, double, ref EnumPushDirection)

Returns a new x coordinate that's ensured to be outside this cuboid. Used for collision detection.

public override double pushOutX(Cuboidd from, double x, ref EnumPushDirection direction)

Parameters

from Cuboidd
x double
direction EnumPushDirection

Returns

double

pushOutY(Cuboidd, double, ref EnumPushDirection)

Returns a new y coordinate that's ensured to be outside this cuboid. Used for collision detection.

public override double pushOutY(Cuboidd from, double y, ref EnumPushDirection direction)

Parameters

from Cuboidd
y double
direction EnumPushDirection

Returns

double

pushOutZ(Cuboidd, double, ref EnumPushDirection)

Returns a new z coordinate that's ensured to be outside this cuboid. Used for collision detection.

public override double pushOutZ(Cuboidd from, double z, ref EnumPushDirection direction)

Parameters

from Cuboidd
z double
direction EnumPushDirection

Returns

double