Simple3D
Search Results for

    Show / Hide Table of Contents

    Class Shape

    An immutable primitive, indexed mesh instance, or transform group.

    Inheritance
    object
    Shape
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Simple3D.Core
    Assembly: Simple3D.Core.dll
    Syntax
    public sealed class Shape

    Properties

    | Edit this page View Source

    Children

    Immutable child nodes, transformed in this node's coordinate system.

    Declaration
    public IReadOnlyList<Shape> Children { get; }
    Property Value
    Type Description
    IReadOnlyList<Shape>
    | Edit this page View Source

    Color

    Opaque packed 0xAARRGGBB surface color.

    Declaration
    public uint Color { get; }
    Property Value
    Type Description
    uint
    | Edit this page View Source

    Geometry

    Indexed geometry, or null for untextured cached primitives and groups.

    Declaration
    public Mesh? Geometry { get; }
    Property Value
    Type Description
    Mesh
    | Edit this page View Source

    Material

    Surface appearance.

    Declaration
    public Material Material { get; }
    Property Value
    Type Description
    Material
    | Edit this page View Source

    MorphWeights

    Current morph target weights of this node's skinned geometry, or null when it has none set.

    Declaration
    public IReadOnlyList<float>? MorphWeights { get; }
    Property Value
    Type Description
    IReadOnlyList<float>
    | Edit this page View Source

    Name

    Optional application identifier.

    Declaration
    public string? Name { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Pose

    Current pose of this node's skinned geometry, or null.

    Declaration
    public SkeletonPose? Pose { get; }
    Property Value
    Type Description
    SkeletonPose
    | Edit this page View Source

    Position

    Local position relative to the parent.

    Declaration
    public Vector3 Position { get; }
    Property Value
    Type Description
    Vector3
    | Edit this page View Source

    Rotation

    Local Euler rotation in radians. For nodes imported from glTF it approximates the exact imported rotation, which Rotated(float, float, float) replaces.

    Declaration
    public Vector3 Rotation { get; }
    Property Value
    Type Description
    Vector3
    | Edit this page View Source

    Size

    Positive local scale factors.

    Declaration
    public Vector3 Size { get; }
    Property Value
    Type Description
    Vector3
    | Edit this page View Source

    SkinnedMesh

    Skinned geometry of this node, or null.

    Declaration
    public SkinnedMesh? SkinnedMesh { get; }
    Property Value
    Type Description
    SkinnedMesh
    | Edit this page View Source

    TriangleCount

    Triangle count of this node, excluding descendants.

    Declaration
    public int TriangleCount { get; }
    Property Value
    Type Description
    int

    Methods

    | Edit this page View Source

    Arrow(Vector3, Vector3, float, uint)

    Creates a cylindrical shaft and conical arrowhead between distinct finite endpoints.

    Declaration
    public static Shape Arrow(Vector3 start, Vector3 end, float thickness = 0.03, uint color = 4286356991)
    Parameters
    Type Name Description
    Vector3 start
    Vector3 end
    float thickness
    uint color
    Returns
    Type Description
    Shape
    | Edit this page View Source

    At(float, float, float)

    Returns a copy with an absolute position, preserving rotation and size.

    Declaration
    public Shape At(float x, float y, float z)
    Parameters
    Type Name Description
    float x
    float y
    float z
    Returns
    Type Description
    Shape
    | Edit this page View Source

    Box(uint)

    Creates a cached unit box centered at the origin.

    Declaration
    public static Shape Box(uint color = 4286356991)
    Parameters
    Type Name Description
    uint color
    Returns
    Type Description
    Shape
    | Edit this page View Source

    Cylinder(uint)

    Creates a cached unit cylinder centered at the origin.

    Declaration
    public static Shape Cylinder(uint color = 4286174913)
    Parameters
    Type Name Description
    uint color
    Returns
    Type Description
    Shape
    | Edit this page View Source

    FromMesh(Mesh, Material?)

    Creates an instance sharing an immutable indexed mesh.

    Declaration
    public static Shape FromMesh(Mesh mesh, Material? material = null)
    Parameters
    Type Name Description
    Mesh mesh
    Material material
    Returns
    Type Description
    Shape
    | Edit this page View Source

    FromSkinnedMesh(SkinnedMesh, Material?)

    Creates an instance of skinned geometry in its skeleton's rest pose.

    Declaration
    public static Shape FromSkinnedMesh(SkinnedMesh mesh, Material? material = null)
    Parameters
    Type Name Description
    SkinnedMesh mesh
    Material material
    Returns
    Type Description
    Shape
    | Edit this page View Source

    Group(params Shape[])

    Creates an immutable group. Children are copied; maximum hierarchy depth is 64.

    Declaration
    public static Shape Group(params Shape[] children)
    Parameters
    Type Name Description
    Shape[] children
    Returns
    Type Description
    Shape
    | Edit this page View Source

    Line(Vector3, Vector3, float, uint)

    Creates a cylindrical line between distinct finite endpoints. Thickness is a world-space diameter.

    Declaration
    public static Shape Line(Vector3 start, Vector3 end, float thickness = 0.03, uint color = 4286356991)
    Parameters
    Type Name Description
    Vector3 start
    Vector3 end
    float thickness
    uint color
    Returns
    Type Description
    Shape
    | Edit this page View Source

    Named(string?)

    Returns a copy with an application identifier.

    Declaration
    public Shape Named(string? name)
    Parameters
    Type Name Description
    string name
    Returns
    Type Description
    Shape
    | Edit this page View Source

    Pyramid(uint)

    Creates a cached unit pyramid centered at the origin.

    Declaration
    public static Shape Pyramid(uint color = 4293170635)
    Parameters
    Type Name Description
    uint color
    Returns
    Type Description
    Shape
    | Edit this page View Source

    Rotated(float, float, float)

    Returns a copy with absolute Euler angles in radians, preserving position and size.

    Declaration
    public Shape Rotated(float x, float y, float z)
    Parameters
    Type Name Description
    float x
    float y
    float z
    Returns
    Type Description
    Shape
    | Edit this page View Source

    Scaled(float)

    Returns a copy with a uniform size; repeated calls replace the previous size.

    Declaration
    public Shape Scaled(float size)
    Parameters
    Type Name Description
    float size
    Returns
    Type Description
    Shape
    | Edit this page View Source

    Scaled(float, float, float)

    Returns a copy with absolute positive dimensions, preserving position and rotation.

    Declaration
    public Shape Scaled(float x, float y, float z)
    Parameters
    Type Name Description
    float x
    float y
    float z
    Returns
    Type Description
    Shape
    | Edit this page View Source

    Sphere(uint)

    Creates a cached unit sphere centered at the origin.

    Declaration
    public static Shape Sphere(uint color = 4294950000)
    Parameters
    Type Name Description
    uint color
    Returns
    Type Description
    Shape
    | Edit this page View Source

    WithMaterial(Material)

    Returns a copy with a different immutable material.

    Declaration
    public Shape WithMaterial(Material material)
    Parameters
    Type Name Description
    Material material
    Returns
    Type Description
    Shape
    | Edit this page View Source

    WithMorphWeights(SkinnedMesh, ReadOnlySpan<float>)

    Returns a copy in which every node using mesh blends its morph targets with weights (one per target, each in [0,1]). Throws when no node uses the mesh.

    Declaration
    public Shape WithMorphWeights(SkinnedMesh mesh, ReadOnlySpan<float> weights)
    Parameters
    Type Name Description
    SkinnedMesh mesh
    ReadOnlySpan<float> weights
    Returns
    Type Description
    Shape
    | Edit this page View Source

    WithPose(SkeletonPose)

    Returns a copy in which this node and every descendant skinned by the pose's skeleton use the pose. Throws when none does.

    Declaration
    public Shape WithPose(SkeletonPose pose)
    Parameters
    Type Name Description
    SkeletonPose pose
    Returns
    Type Description
    Shape
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX