Class MyBlockBuilderBase
Inheritance
System.Object
MyBlockBuilderBase
Assembly: Sandbox.Game.dll
Syntax
public abstract class MyBlockBuilderBase : MySessionComponentBase, IMyUserInputComponent
Constructors
MyBlockBuilderBase()
Declaration
protected MyBlockBuilderBase()
Fields
m_cubeBuilderDefinition
Declaration
protected static MyCubeBuilderDefinition m_cubeBuilderDefinition
Field Value
m_currentGrid
Declaration
protected MyCubeGrid m_currentGrid
Field Value
m_currentVoxelBase
Declaration
protected MyVoxelBase m_currentVoxelBase
Field Value
m_hitInfo
Declaration
protected Nullable<MyPhysics.HitInfo> m_hitInfo
Field Value
Type |
Description |
System.Nullable<Sandbox.Engine.Physics.MyPhysics.HitInfo> |
|
m_invGridWorldMatrix
Declaration
protected MatrixD m_invGridWorldMatrix
Field Value
m_rotationControls
Declaration
protected static readonly MyStringId[] m_rotationControls
Field Value
m_rotationDirections
Declaration
protected static readonly int[] m_rotationDirections
Field Value
Type |
Description |
System.Int32[] |
|
Properties
CameraControllerSpectator
Declaration
public static bool CameraControllerSpectator { get; }
Property Value
Type |
Description |
System.Boolean |
|
CubeBuilderDefinition
Declaration
public static MyCubeBuilderDefinition CubeBuilderDefinition { get; }
Property Value
CurrentBlockDefinition
Declaration
public abstract MyCubeBlockDefinition CurrentBlockDefinition { get; protected set; }
Property Value
CurrentGrid
Declaration
protected abstract MyCubeGrid CurrentGrid { get; set; }
Property Value
CurrentVoxelBase
Declaration
protected abstract MyVoxelBase CurrentVoxelBase { get; set; }
Property Value
FreePlacementTarget
Declaration
public Vector3D FreePlacementTarget { get; }
Property Value
HitInfo
Declaration
public Nullable<MyPhysics.HitInfo> HitInfo { get; }
Property Value
Type |
Description |
System.Nullable<Sandbox.Engine.Physics.MyPhysics.HitInfo> |
|
IntersectionDirection
Declaration
public static Vector3D IntersectionDirection { get; }
Property Value
IntersectionDistance
Declaration
public static float IntersectionDistance { get; set; }
Property Value
Type |
Description |
System.Single |
|
IntersectionStart
Declaration
public static Vector3D IntersectionStart { get; }
Property Value
IsActivated
Declaration
public abstract bool IsActivated { get; }
Property Value
Type |
Description |
System.Boolean |
|
PlacementProvider
Declaration
public static IMyPlacementProvider PlacementProvider { get; set; }
Property Value
Type |
Description |
Sandbox.Game.Entities.Cube.IMyPlacementProvider |
|
SpectatorIsBuilding
Declaration
public static bool SpectatorIsBuilding { get; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
Activate(Nullable<MyDefinitionId>, Boolean)
Declaration
public abstract void Activate(Nullable<MyDefinitionId> blockDefinitionId = null, bool groupwideDLCCheck = false)
Parameters
Type |
Name |
Description |
System.Nullable<MyDefinitionId> |
blockDefinitionId |
|
System.Boolean |
groupwideDLCCheck |
|
AddFastBuildModelWithSubparts(ref MatrixD, List<MatrixD>, List<String>, MyCubeBlockDefinition, Single)
Declaration
protected static void AddFastBuildModelWithSubparts(ref MatrixD matrix, List<MatrixD> matrices, List<string> models, MyCubeBlockDefinition blockDefinition, float gridScale)
Parameters
Type |
Name |
Description |
MatrixD |
matrix |
|
System.Collections.Generic.List<MatrixD> |
matrices |
|
System.Collections.Generic.List<System.String> |
models |
|
MyCubeBlockDefinition |
blockDefinition |
|
System.Single |
gridScale |
|
ChooseHitObject()
Declaration
protected virtual void ChooseHitObject()
ComputeSteps(Vector3I, Vector3I, Vector3I, out Vector3I, out Vector3I, out Int32)
Declaration
public static void ComputeSteps(Vector3I start, Vector3I end, Vector3I rotatedSize, out Vector3I stepDelta, out Vector3I counter, out int stepCount)
Parameters
Deactivate()
Declaration
public abstract void Deactivate()
FindClosestGrid()
Declaration
public MyCubeGrid FindClosestGrid()
Returns
FindClosestPlacementObject(out MyCubeGrid, out MyVoxelBase)
Finds closest object (grid or voxel map) for placement of blocks .
Declaration
public bool FindClosestPlacementObject(out MyCubeGrid closestGrid, out MyVoxelBase closestVoxelMap)
Parameters
Returns
Type |
Description |
System.Boolean |
|
GetBlockAddPosition(Single, Boolean, out MySlimBlock, out Vector3D, out Vector3D, out Vector3I, out Vector3I, out Nullable<UInt16>)
Declaration
protected bool GetBlockAddPosition(float gridSize, bool placingSmallGridOnLargeStatic, out MySlimBlock intersectedBlock, out Vector3D intersectedBlockPos, out Vector3D intersectExactPos, out Vector3I addPositionBlock, out Vector3I addDirectionBlock, out Nullable<ushort> compoundBlockId)
Parameters
Type |
Name |
Description |
System.Single |
gridSize |
|
System.Boolean |
placingSmallGridOnLargeStatic |
|
Sandbox.Game.Entities.Cube.MySlimBlock |
intersectedBlock |
|
Vector3D |
intersectedBlockPos |
|
Vector3D |
intersectExactPos |
|
Vector3I |
addPositionBlock |
|
Vector3I |
addDirectionBlock |
|
System.Nullable<System.UInt16> |
compoundBlockId |
|
Returns
Type |
Description |
System.Boolean |
|
GetCubeAddAndRemovePositions(Vector3I, Boolean, out Vector3I, out Vector3I, out Vector3I)
Declaration
protected bool GetCubeAddAndRemovePositions(Vector3I intersectedCube, bool placingSmallGridOnLargeStatic, out Vector3I addPos, out Vector3I addDir, out Vector3I removePos)
Parameters
Returns
Type |
Description |
System.Boolean |
|
GetCubeBoundingBox(Vector3I)
Declaration
protected BoundingBoxD GetCubeBoundingBox(Vector3I cubePos)
Parameters
Returns
GetIntersectedBlockData(ref MatrixD, out Vector3D, out MySlimBlock, out Nullable<UInt16>)
Calculates exact intersection point (in uniform grid coordinates) from stored havok's hit info object obtained during FindClosest grid.
Returns position of intersected object in uniform grid coordinates.
Declaration
protected Nullable<Vector3D> GetIntersectedBlockData(ref MatrixD inverseGridWorldMatrix, out Vector3D intersection, out MySlimBlock intersectedBlock, out Nullable<ushort> compoundBlockId)
Parameters
Type |
Name |
Description |
MatrixD |
inverseGridWorldMatrix |
|
Vector3D |
intersection |
|
Sandbox.Game.Entities.Cube.MySlimBlock |
intersectedBlock |
|
System.Nullable<System.UInt16> |
compoundBlockId |
|
Returns
Type |
Description |
System.Nullable<Vector3D> |
|
InitFromDefinition(MySessionComponentDefinition)
Declaration
public override void InitFromDefinition(MySessionComponentDefinition definition)
Parameters
Type |
Name |
Description |
VRage.Game.Components.Session.MySessionComponentDefinition |
definition |
|
Overrides
IntersectCubes(MyCubeGrid, out Double)
Declaration
protected Nullable<Vector3I> IntersectCubes(MyCubeGrid grid, out double distance)
Parameters
Type |
Name |
Description |
MyCubeGrid |
grid |
|
System.Double |
distance |
|
Returns
Type |
Description |
System.Nullable<Vector3I> |
|
IntersectExact(MyCubeGrid, ref MatrixD, out Vector3D, out MySlimBlock)
Calculates exact intersection point (in uniform grid coordinates) of eye ray with the given grid of all cubes.
Returns position of intersected object in uniform grid coordinates
Declaration
protected Nullable<Vector3D> IntersectExact(MyCubeGrid grid, ref MatrixD inverseGridWorldMatrix, out Vector3D intersection, out MySlimBlock intersectedBlock)
Parameters
Type |
Name |
Description |
MyCubeGrid |
grid |
|
MatrixD |
inverseGridWorldMatrix |
|
Vector3D |
intersection |
|
Sandbox.Game.Entities.Cube.MySlimBlock |
intersectedBlock |
|
Returns
Type |
Description |
System.Nullable<Vector3D> |
|
IntersectInflated(List<Vector3I>, MyCubeGrid)
Declaration
protected void IntersectInflated(List<Vector3I> outHitPositions, MyCubeGrid grid)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<Vector3I> |
outHitPositions |
|
MyCubeGrid |
grid |
|