Libprimis
Imprimis' 3D destroyable world engine
Loading...
Searching...
No Matches
selinfo Struct Reference

A representation of a rectangular volume of cubes. More...

#include <octa.h>

Public Member Functions

int size () const
 Returns the volume of the selection.
 
int us (int d) const
 Returns the absolute size of the selection along the specified axis.
 
bool operator== (const selinfo &sel) const
 Returns whether the two selections occupy the same space.
 
bool validate ()
 Keeps the selection within the world.
 

Public Attributes

int corner
 
int cx
 
int cxs
 
int cy
 
int cys
 
ivec o
 
ivec s
 
int grid
 
int orient
 

Detailed Description

A representation of a rectangular volume of cubes.

Member Function Documentation

◆ operator==()

bool selinfo::operator== ( const selinfo & sel) const
inline

Returns whether the two selections occupy the same space.

Requires that the two selections are occupying the same volume in the world space, and both are of the same gridpower and orientation (selected face). Otherwise, false is returned.

◆ size()

int selinfo::size ( ) const
inline

Returns the volume of the selection.

The volume returned is in the units of the gridpower being used, so selections with the same cube dimensions but different gridpowers will have the same volume.

Returns
the volume of the selection (l*w*h)

◆ us()

int selinfo::us ( int d) const
inline

Returns the absolute size of the selection along the specified axis.

Parameters
dthe dimension to query (0 for x, 1 for y, 2 for z)
Returns
the absolute size of the selection along that axis

◆ validate()

bool selinfo::validate ( )

Keeps the selection within the world.

Returns
false if the selection attempts to leave the bounds of the world

Member Data Documentation

◆ grid

int selinfo::grid

the gridscale of the selection

◆ o

ivec selinfo::o

the coordinates from which the selection starts

◆ orient

int selinfo::orient

the orientation of the selection

◆ s

ivec selinfo::s

the offset vector conveying the size of the selection


The documentation for this struct was generated from the following file: