Skip to content

struct

HtmlAnchor

pub struct HtmlAnchor {
    pub path: Vec<usize>,
    pub local: Transform,
    pub parent: Mat4,
    pub object: Option<usize>,
    pub transform: bool,
    pub distance_factor: Option<f32>,
    pub center: bool,
    pub occlude: bool,
}

An html element in a scene: where its DOM goes.

html(position: "0 1 0", distance-factor: 8, occlude: true) { Card { … } }   // pinned
html(transform: true, rotation: "0 30 0", scale: 0.01) { … }               // on a plane
mesh { sphereGeometry(…) html(position: "0 1.2 0") { Badge "Sphere" } }     // on an object

Fields

path

pub path: Vec<usize>

The html element's path within the surface.

local

pub local: Transform

Its own transform (position, rotation, scale).

parent

pub parent: Mat4

What it's in: enclosing groups…

object

pub object: Option<usize>

…or the object it's attached to (its pose, motion included, applies).

transform

pub transform: bool

On a plane in the scene (CSS 3D transform) rather than pinned to a point and facing the screen.

distance_factor

pub distance_factor: Option<f32>

Pinned: scale with distance, this being the distance at which it's its natural size. Transform: world units per CSS pixel × 100.

center

pub center: bool

Centre it on its point (else its top-left corner is there).

occlude

pub occlude: bool

Hide it while another object is in front of it.

Trait implementations