UltrasoundMaterial.cs - UF-CSSALT/SMARTS-SDK-Unity-Asset-Package GitHub Wiki
The Ultrasound Material script defines the material that the ultrasound is rendered upon and its characteristics.
Namespace
SMARTS_SDK.Ultrasound
To use the UltrasoundManager.cs script and access its functionality, any scripts must be using the SMARTS_SDK.Ultrasound namespace.
Public Enums
RenderType
The RenderType enumerator determines the type of surface that will be rendered. It has five possible states:
- Normal : Simply render the color on the ultrasound screen.
- Bone : Color on surface, with shadow.
- Lung : Color on surface, with lung sliders and noise artifacts.
- Texture1 : Perlin-like noise using texture settings 1.
- Texture2 : Perlin-like noise using texture settings 2.
Public Fields
bool ShowOnUltrasound
RenderTypeType
Determines the render type of the ultrasound material.
Color Color
Determines the color setting of the ultrasound material.
float AnisoIndex
This represents the Anisotropy Index. The Anisotropy Index determines how visible the object is in relation to the incident angle of the ultrasound insonating ray. The visibility of the object varies with relation to the Anisotropy Index as follows:
- 0° : No anistotropy - the angle does not matter. This is the default value.
- 45° : The object will begin to fade out at about 70 degrees and disappear at about 45 degrees.
- 65° : This seems about accurate for needles and lungs on newer US machines.
- 90° : The object will be practically invisible at this angle. The object will be shown only for ultrasound insonatiny rays that are 90 degrees to the object's surface.
Private Fields
int hitCount
This variable is an accumulator for ultrasound insonating beam hits. If the material is not under the insonating beam, this accumulator stays at zero. It should be polled on Update and is cleared in LateUpdate.
Public Methods
int GetHitCount()
Returns the number of hit counts that have occured.
void NoteHit()
Increments the hit counter.
void LateUpdate()
Resets the hit counter back to 0.