Teleportations

class Teleportation(set, jsTest, glslTest, elt, inv, glslCreep)

A teleportation is a tool to bring back a point in a prescribed fundamental domain of a discrete group. It consists of a test to decide if teleportation is needed and the group element to apply to teleport the point

Constructor Use instead the add method of the class TeleportationSet

Arguments:
  • set (TeleportationSet) – The set the teleportation belongs to

  • jsTest (function) – A JS test saying if a teleportation is needed. The test is a function with the signature Point -> boolean.

  • glslTest (string) – a chunk of GLSL performing the same test. The test should be encapsulated in a function with signature Point -> bool

  • elt (GroupElement) – the isometry to apply when teleporting

  • inv (GroupElement) – the inverse of the isometry (optional) If the inverse is not passed as an argument, it is computed automatically.

  • glslCreep (string) – a chunk of GLSL to move to the boundary defined by the test. The test should be encapsulated in a function with signature ExtVector, float, float -> float

Teleportation.Teleportation

Constructor Use instead the add method of the class TeleportationSet

Teleportation.elt

type: GroupElement

The element to apply when teleporting

Teleportation.glslCreep

type: string

Chunk of GLSL to move to the boundary defined by the test

Teleportation.glslCreepCustom

type: boolean

Say if the creeping uses a custom function of the default one The two functions do not have the same signature.

Teleportation.glslCreepName

type: string

Name of the GLSL function performing the test. Computed with a regular expression

Teleportation.glslTest

type: string

A GLSL test saying if a teleportation is needed The test returns true if a teleportation is needed and false otherwise.

Teleportation.glslTestName

type: string

Name of the GLSL function performing the test. Computed with a regular expression

Teleportation.inv

type: GroupElement

The inverse of the teleporting element

Teleportation.jsTest

type: function

A JS test saying if a teleportation is needed The test is a function with the signature Point -> boolean The test returns true if a teleportation is needed and false otherwise.

Teleportation.name

type: string

The name of the item. This name is computed (from the uuid) the first time the getter is called.

Teleportation.set

type: TeleportationSet

The set the teleportation belongs to.

Teleportation.usesCreepingBinary

type: boolean

Return true if the following conditions are satisfies - the teleportation set uses full creeping - no custom creeping function exists

Teleportation.usesCreepingCustom

type: boolean

Return true if the following conditions are satisfies - the teleportation set uses creeping (strict or full) - a custom creeping function exists

Teleportation.uuid

type: string

Universal unique ID. The dashes are replaced by underscored to avoid problems in the shaders

Teleportation.shader(shaderBuilder)

Build the GLSL code performing the associated test.

Arguments:
  • shaderBuilder (ShaderBuilder) –

class TeleportationSet(neighbors, usesNearestNeighbors=false, creepingType)

Set of teleportations. It is implicitly a set of generators of a discrete subgroup and a fundamental domain for this subgroup

Constructor

Arguments:
  • neighbors (Array.<{elt:GroupElement, inv:GroupElement}>) – the list of neighbors when using nearest neighbors. The elements come by pair : an element and its inverse. defining the structure of the group element and the related functions

  • usesNearestNeighbors (boolean) –

  • creepingType (number) – type of creeping used for quotient manifold (see description in the constants)

TeleportationSet.TeleportationSet

Constructor

TeleportationSet.creepingType

Flag : type of creeping used Default is CREEPING_OFF.

TeleportationSet.group

type: Group

Shortcut to the underlying group. If the list of teleportations is empty, use the trivial group.

TeleportationSet.neighbors

The list of neighbors when using nearest neighbors.

TeleportationSet.teleportations

type: Array.<Teleportation>

The list of teleports “generating” the subgroups. The order matters (see the class description).

TeleportationSet.usesCreeping

Return true if the set uses some kind of creeping

TeleportationSet.usesNearestNeighbors

Flag : uses nearest neighbor or not (for local SDF) Default is false.

TeleportationSet.add(jsTest, glslTest, elt, inv, glslCreep)

Add a teleportation to the list of teleportations

Arguments:
  • jsTest (function) – A JS test saying if a teleportation is needed. The test is a function with the signature Point -> boolean.

  • glslTest (string) – a chunk of GLSL performing the same test. The test should be encapsulated in a function with signature Point -> bool

  • elt (GroupElement) – the isometry to apply when teleporting

  • inv (GroupElement) – the inverse of the isometry (optional) If the inverse is not passed as an argument, it is computed automatically.

  • glslCreep (string) – a chunk of GLSL to move to the boundary defined by the test

Returns:

TeleportationSet – - the teleportation set

TeleportationSet.shader(shaderBuilder)

Goes through all the teleportations in the discrete subgroup and build the GLSL code performing the associated test.

Arguments:
  • shaderBuilder (ShaderBuilder) –

class RelPosition(set)

Relative position. A general position is represented as a pair \((h,p)\) where

  • \(h\) (cellBoost) is a GroupElement representing an element of a discrete subgroups

  • \(p\) (local) is a Position

The frame represented by the relative position is the image by \(h\) of the frame represented by the position \(p\)

We split the isometry part \(hg\) in two pieces. The idea is that \(g\) should give a position in the fundamental domain of the (implicit) underlying lattice. This will keep the coordinates of \(g\) in a bounded range.

For simplicity, we also keep track of the inverse of the cellBoost.

Constructor. Return the position corresponding to the origin with the reference frame.

Arguments:
RelPosition.cellBoost

type: GroupElement

the “discrete” component of the isometry par of the boost

RelPosition.facing

Facing of the local part of the relative position

RelPosition.globalBoost

Return the global isometry (cellBoost * local boost) of the current position

RelPosition.globalPosition

Return a global position (with no cell boost) representing the current relative position

RelPosition.invCellBoost

type: GroupElement

the inverse of cellBoost

RelPosition.local

type: Position

the local position

RelPosition.localPoint

type: Point

The underlying local point (i.e. ignoring the cell boost)

RelPosition.point

type: Point

The underlying point (taking into account the cell boost)

RelPosition.set

type: TeleportationSet

the isometry component of the position inside the fundamental domain

RelPosition.applyQuaternion(quaternion)

Rotate the facing by m (right action of O(3) in the set of positions).

Arguments:
  • quaternion (Quaternion) – An isometry of the tangent space at the origin, i.e. a matrix in O(3).

Returns:

RelPosition – the updated version of the current Position

RelPosition.clone()

Return a new copy of the current position.

Returns:

RelPosition – the clone of the current relative position

RelPosition.copy(position)

Set the current position with the given position.

Arguments:
  • position (RelPosition) – the relative position to copy

Returns:

RelPosition – the current relative position

RelPosition.equals(position)

Check if the current position and `position ` are the same. Mainly for debugging purposes

Arguments:
Returns:

boolean – true if the relative positions are the same, false otherwise

RelPosition.fakeDiffExpMap(matrix)

Fake version of the differential of the exponential map. We do not incorporate any teleportation here. (See {@link Position} for details)

Arguments:
  • matrix (Matrix4) – an affine isometry of the tangent space at the origin

Returns:

RelPosition

RelPosition.flow(v)

Flow the current position. v is the pullback at the origin by the position of the direction in which we flow The time by which we flow is the norm of v This method makes sure that the boost stays in the fundamental domain

Arguments:
  • v (Vector) – the direction (and length) to follow

Returns:

RelPosition – the current relative position

RelPosition.reduceError()

Reduce the eventual numerical error of the current position.

Returns:

RelPosition – the current relative position

RelPosition.reduceErrorBoost()

Reduce the eventual numerical error of the current boost.

Returns:

RelPosition – the current relative position

RelPosition.reduceErrorFacing()

Reduce the eventual numerical error of the current facing.

Returns:

RelPosition – the current relative position

RelPosition.reduceErrorLocal()

Reduce the eventual numerical error of the current facing.

Returns:

RelPosition – the current relative position

RelPosition.reset()

Reset the position in its default position (boost = identity, quaternion = 1)

Returns:

RelPosition – The current position

RelPosition.teleport()

Apply if needed a teleportation to bring back the local boos in the fundamental domain

Returns:

RelPosition – the current relative position