    

 ## On this page

  

 

 # IRockyJointScalars Struct Reference

 Last update: 16.07.2025 

`#include <<a class="el" href="rocky__joint__scalars_8hpp_source.xhtml">rocky_joint_scalars.hpp</a>>`

Inherits EntityScalars&lt; rocky20::JointScalars &gt;.

## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

ROCKY\_FUNCTIONS double [get\_scalar](#a99bd176be9958223d6dc2a9e62f7ec30) (int scalar\_index) const ROCKY\_FUNCTIONS void [set\_scalar](#a41d7ac3675a9d3ee3e79cd79c9de1f26) (int scalar\_index, double value) const ROCKY\_FUNCTIONS void [add\_scalar](#abc05fdd6e7595ea79f4fa0aeafd93552) (int scalar\_index, double value) const ROCKY\_FUNCTIONS void [max\_scalar](#a5e95059b8068dc460f40119e2a58d32f) (int scalar\_index, double value) const <a id="details" name="details"></a>## Detailed Description

When running a simulation an `<a class="el" href="structIRockyJointScalars.xhtml">IRockyJointScalars</a>` object gives access to all joint scalars defined in the project. These joint scalars can be built-in scalars defined in the solver, or custom joint scalars defined by the current module or other active modules.



## Member Function Documentation

<a id="abc05fdd6e7595ea79f4fa0aeafd93552" name="abc05fdd6e7595ea79f4fa0aeafd93552"></a>## [◆ ](#abc05fdd6e7595ea79f4fa0aeafd93552)add\_scalar()

 ROCKY\_FUNCTIONS void IRockyJointScalars::add\_scalar  ( int *scalar\_index*,    double *value* ) const

If a custom scalar variable was defined during the setup of the module,this method can be used to sum a value to the current one stored in it.Parameters scalar\_indexThe integer index that was associated to the scalar variable during the setup of the module.valueThe value that must be summed to the current stored value.  




<a id="a99bd176be9958223d6dc2a9e62f7ec30" name="a99bd176be9958223d6dc2a9e62f7ec30"></a>## [◆ ](#a99bd176be9958223d6dc2a9e62f7ec30)get\_scalar()

 ROCKY\_FUNCTIONS double IRockyJointScalars::get\_scalar  ( int *scalar\_index*)  const

If a custom scalar variable was defined during the setup of the module,the value currently stored can be accessed with this method.Parameters scalar\_indexThe integer index that was associated to the scalar variable during the setup of the module.ReturnsThe value currently stored in the scalar variable. 



<a id="a5e95059b8068dc460f40119e2a58d32f" name="a5e95059b8068dc460f40119e2a58d32f"></a>## [◆ ](#a5e95059b8068dc460f40119e2a58d32f)max\_scalar()

 ROCKY\_FUNCTIONS void IRockyJointScalars::max\_scalar  ( int *scalar\_index*,    double *value* ) const

If a custom scalar variable was defined during the setup of the module,this method can be used to make the scalar store the maximum of a set of values. A common use of this method is, for instance, to find the maximum among a set of values associated to the contacts of a particle.Parameters scalar\_indexThe integer index that was associated to the scalar variable during the setup of the module.valueA value that must be checked if it is greater than the current stored value. 



<a id="a41d7ac3675a9d3ee3e79cd79c9de1f26" name="a41d7ac3675a9d3ee3e79cd79c9de1f26"></a>## [◆ ](#a41d7ac3675a9d3ee3e79cd79c9de1f26)set\_scalar()

 ROCKY\_FUNCTIONS void IRockyJointScalars::set\_scalar  ( int *scalar\_index*,    double *value* ) const

If a custom scalar variable was defined during the setup of the module,this method can be used to store a value on it.Parameters scalar\_indexThe integer index that was associated to the scalar variable during the setup of the module.valueThe value that must be stored.