Stellarium  HEAD
Public Slots | Public Member Functions
V3f Class Reference

V3f is a glue class to allow some interaction between Vec3f and the scripting system. More...

#include <V3d.hpp>

Public Slots

Q_INVOKABLE Vec3d toVec3d () const
 
Q_INVOKABLE Vec3f toVec3f () const
 
Q_INVOKABLE float x () const
 
Q_INVOKABLE float y () const
 
Q_INVOKABLE float z () const
 
Q_INVOKABLE void set (const float x, const float y, const float z)
 Sets the components.
 
Q_INVOKABLE void setX (float x)
 Sets the X component.
 
Q_INVOKABLE void setY (float y)
 Sets the Y component.
 
Q_INVOKABLE void setZ (float z)
 Sets the Z component.
 
Q_INVOKABLE QString toString () const
 Formats a comma-separated string in angle brackets. More...
 
Q_INVOKABLE QString toHex () const
 Formats a hex string usable as HTML color.
 

Public Member Functions

Q_INVOKABLE V3f (const V3f &other)
 
V3foperator= (const V3f &v)
 
Q_INVOKABLE V3f (const float x, const float y, const float z)
 The usual constructor to create a 3-dimensional vector that can be manipulated in JavaScript.
 
Q_INVOKABLE V3f (const Vec3f &vec)
 Create a 3-dimensional vector from a Vec3f that can later be manipulated in JavaScript, e.g. More...
 

Detailed Description

V3f is a glue class to allow some interaction between Vec3f and the scripting system.

Vec3f is not scriptable with the QJSEngine, but this intermediate V3f allows calling slots which require a Vec3f argument in a way similar to V3d.

Constructor & Destructor Documentation

◆ V3f()

Q_INVOKABLE V3f::V3f ( const Vec3f vec)
inline

Create a 3-dimensional vector from a Vec3f that can later be manipulated in JavaScript, e.g.

Member Function Documentation

◆ toString

Q_INVOKABLE QString V3f::toString ( ) const
inlineslot

Formats a comma-separated string in angle brackets.

JS print output shows "V3f(address)". Use toVec3f() to show the values formatted by Vec3f's method.

◆ toVec3f

Q_INVOKABLE Vec3f V3f::toVec3f ( ) const
inlineslot
Returns
a Vec3f object which is not directly accessible by scripts but can be used as arguments to other calls.

◆ x

Q_INVOKABLE float V3f::x ( ) const
inlineslot
Returns
the X component

◆ y

Q_INVOKABLE float V3f::y ( ) const
inlineslot
Returns
the Y component

◆ z

Q_INVOKABLE float V3f::z ( ) const
inlineslot
Returns
the Z component