Photon Fusion 1.1.12

Public Member Functions | Static Public Member Functions | Properties | List of all members
Accuracy Struct Reference

Indicates the rounding factor of compressed values. All values will be truncated to the nearest multiple of this. More...

Public Member Functions

 Accuracy (float accuracy)
 Accuracy constructor. The provided float value is used to determine the rounding. For example, an accuracy of .01f would result in the value .02345 being rounded to .02f. More...
 
 Accuracy (string tag)
 Accuracy constructor for named AccuracyDefaults usage. Pass the named default to this constructor. The Value, Inverse properties and the GetReadAccuracy(NetworkProjectConfig) and GetWriteAccuracy(NetworkProjectConfig) methods will lookup their return values using the AccuracyDefaults in the supplied NetworkRunner.Config. More...
 
ReadAccuracy GetReadAccuracy (NetworkProjectConfig config)
 Gets the ReadAccuracy value used for float decompression. More...
 
WriteAccuracy GetWriteAccuracy (NetworkProjectConfig config)
 Gets the WriteAccuracy value used for float compression. More...
 
override string ToString ()
 Summary text for this accuracy. More...
 

Static Public Member Functions

static implicit operator Accuracy (float value)
 Implicit operator to convert floats into accuracy. More...
 

Properties

float Value [get]
 The accuracy value that is used as a rounding factor for Fusion's compression. All values will be truncated to the nearest multiple of this. More...
 

Detailed Description

Indicates the rounding factor of compressed values. All values will be truncated to the nearest multiple of this.

For example; A value of 0.012345f compressed with an Accuracy of 0.001, becomes 0.012f

An Accuracy setting of 0 is uncompressed.

Constructor & Destructor Documentation

◆ Accuracy() [1/2]

Accuracy ( float  accuracy)

Accuracy constructor. The provided float value is used to determine the rounding. For example, an accuracy of .01f would result in the value .02345 being rounded to .02f.

Parameters
accuracy

◆ Accuracy() [2/2]

Accuracy ( string  tag)

Accuracy constructor for named AccuracyDefaults usage. Pass the named default to this constructor. The Value, Inverse properties and the GetReadAccuracy(NetworkProjectConfig) and GetWriteAccuracy(NetworkProjectConfig) methods will lookup their return values using the AccuracyDefaults in the supplied NetworkRunner.Config.

Parameters
tag

Member Function Documentation

◆ GetReadAccuracy()

ReadAccuracy GetReadAccuracy ( NetworkProjectConfig  config)

Gets the ReadAccuracy value used for float decompression.

Parameters
configReference to the project NetworkProjectConfig file, which is needed to look up the global AccuracyDefaults values.

◆ GetWriteAccuracy()

WriteAccuracy GetWriteAccuracy ( NetworkProjectConfig  config)

Gets the WriteAccuracy value used for float compression.

Parameters
configReference to the project Config file, which is needed to look up the global AccuracyDefaults values. Typically this is Runner.Config is used for this value.

◆ operator Accuracy()

static implicit operator Accuracy ( float  value)
static

Implicit operator to convert floats into accuracy.

Parameters
value

◆ ToString()

override string ToString ( )

Summary text for this accuracy.

Returns

Property Documentation

◆ Value

float Value
get

The accuracy value that is used as a rounding factor for Fusion's compression. All values will be truncated to the nearest multiple of this.