group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
EnergyTeslaArcEffect Class Reference

Continuous EnergyGun lightning built on the same ArcVertex path as Railgun. More...

#include <EnergyTeslaArcEffect.hpp>

Classes

struct  PathSample
struct  Branch
struct  Beam

Public Member Functions

void drive (uint32_t key, glm::vec3 origin, glm::vec3 guidePoint, glm::vec3 hitPoint, bool locked, float lockStrength)
void debugPreview (glm::vec3 origin, glm::vec3 guidePoint, glm::vec3 hitPoint, bool locked, float lockStrength)
void debugPulse (glm::vec3 origin, glm::vec3 guidePoint, glm::vec3 hitPoint, bool locked, float lockStrength)
void update (float dt, glm::vec3 camForward)
const ArcVertexmainArcData () const
uint32_t mainArcCount () const
const ArcVertexdetailArcData () const
uint32_t detailArcCount () const
uint32_t arcCount () const
uint32_t activeBeamCount () const

Static Public Member Functions

static PathSample buildGuidePathForTest (glm::vec3 origin, glm::vec3 guidePoint, glm::vec3 hitPoint, bool locked, float lockStrength)

Private Member Functions

BeamfindOrAllocBeam (uint32_t key)
void rerandomizeBranches (Beam &beam)
void appendArcStrip (std::vector< ArcVertex > &out, const std::vector< glm::vec3 > &pts, float radius, glm::vec4 color, glm::vec3 camForward)
void appendLayeredBolt (const std::vector< glm::vec3 > &pts, float fade, float radiusScale, bool primary, glm::vec3 camForward)
void appendBranches (const Beam &beam, const std::vector< glm::vec3 > &mainPts, glm::vec3 axisN, glm::vec3 perp, glm::vec3 perp2, float len, float fade, glm::vec3 camForward)
void appendCorona (glm::vec3 center, glm::vec3 axisN, glm::vec3 perp, glm::vec3 perp2, float len, float fade, float seed, bool targetCorona, glm::vec3 camForward)
void appendEnergyBall (const Beam &beam, glm::vec3 axisN, glm::vec3 perp, glm::vec3 perp2, float len, float fade, glm::vec3 camForward)

Static Private Member Functions

static float hash01 (uint32_t n)
static float smooth01 (float v)
static glm::vec3 safeNormalize (glm::vec3 v, glm::vec3 fallback)
static glm::vec3 cubic (glm::vec3 p0, glm::vec3 p1, glm::vec3 p2, glm::vec3 p3, float t)
static PathSample buildGuidePath (glm::vec3 origin, glm::vec3 guidePoint, glm::vec3 hitPoint, bool locked, float lockStrength)

Private Attributes

std::array< Beam, k_maxBeamsbeams_ {}
std::vector< ArcVertexmainArcVerts_
std::vector< ArcVertexdetailArcVerts_
uint32_t debugPreviewKey_ = 0xEA10u
uint32_t debugKey_ = 0xEA11u

Static Private Attributes

static constexpr int k_maxBeams = 8
static constexpr int k_mainSegs = 32
static constexpr int k_branchSegs = 7
static constexpr int k_maxBranches = 8
static constexpr int k_maxStrands = 3
static constexpr float k_fadeTime = 0.08f
static constexpr float k_branchRetime = 0.045f

Detailed Description

Continuous EnergyGun lightning built on the same ArcVertex path as Railgun.

Member Function Documentation

◆ activeBeamCount()

uint32_t EnergyTeslaArcEffect::activeBeamCount ( ) const
nodiscard

◆ appendArcStrip()

void EnergyTeslaArcEffect::appendArcStrip ( std::vector< ArcVertex > & out,
const std::vector< glm::vec3 > & pts,
float radius,
glm::vec4 color,
glm::vec3 camForward )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendBranches()

void EnergyTeslaArcEffect::appendBranches ( const Beam & beam,
const std::vector< glm::vec3 > & mainPts,
glm::vec3 axisN,
glm::vec3 perp,
glm::vec3 perp2,
float len,
float fade,
glm::vec3 camForward )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendCorona()

void EnergyTeslaArcEffect::appendCorona ( glm::vec3 center,
glm::vec3 axisN,
glm::vec3 perp,
glm::vec3 perp2,
float len,
float fade,
float seed,
bool targetCorona,
glm::vec3 camForward )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendEnergyBall()

void EnergyTeslaArcEffect::appendEnergyBall ( const Beam & beam,
glm::vec3 axisN,
glm::vec3 perp,
glm::vec3 perp2,
float len,
float fade,
glm::vec3 camForward )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendLayeredBolt()

void EnergyTeslaArcEffect::appendLayeredBolt ( const std::vector< glm::vec3 > & pts,
float fade,
float radiusScale,
bool primary,
glm::vec3 camForward )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ arcCount()

uint32_t EnergyTeslaArcEffect::arcCount ( ) const
inlinenodiscard
Here is the call graph for this function:

◆ buildGuidePath()

EnergyTeslaArcEffect::PathSample EnergyTeslaArcEffect::buildGuidePath ( glm::vec3 origin,
glm::vec3 guidePoint,
glm::vec3 hitPoint,
bool locked,
float lockStrength )
staticnodiscardprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildGuidePathForTest()

EnergyTeslaArcEffect::PathSample EnergyTeslaArcEffect::buildGuidePathForTest ( glm::vec3 origin,
glm::vec3 guidePoint,
glm::vec3 hitPoint,
bool locked,
float lockStrength )
staticnodiscard
Here is the call graph for this function:

◆ cubic()

glm::vec3 EnergyTeslaArcEffect::cubic ( glm::vec3 p0,
glm::vec3 p1,
glm::vec3 p2,
glm::vec3 p3,
float t )
staticnodiscardprivate
Here is the caller graph for this function:

◆ debugPreview()

void EnergyTeslaArcEffect::debugPreview ( glm::vec3 origin,
glm::vec3 guidePoint,
glm::vec3 hitPoint,
bool locked,
float lockStrength )
Here is the call graph for this function:

◆ debugPulse()

void EnergyTeslaArcEffect::debugPulse ( glm::vec3 origin,
glm::vec3 guidePoint,
glm::vec3 hitPoint,
bool locked,
float lockStrength )
Here is the call graph for this function:

◆ detailArcCount()

uint32_t EnergyTeslaArcEffect::detailArcCount ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ detailArcData()

const ArcVertex * EnergyTeslaArcEffect::detailArcData ( ) const
inlinenodiscard

◆ drive()

void EnergyTeslaArcEffect::drive ( uint32_t key,
glm::vec3 origin,
glm::vec3 guidePoint,
glm::vec3 hitPoint,
bool locked,
float lockStrength )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findOrAllocBeam()

EnergyTeslaArcEffect::Beam * EnergyTeslaArcEffect::findOrAllocBeam ( uint32_t key)
private
Here is the caller graph for this function:

◆ hash01()

float EnergyTeslaArcEffect::hash01 ( uint32_t n)
staticnodiscardprivate
Here is the caller graph for this function:

◆ mainArcCount()

uint32_t EnergyTeslaArcEffect::mainArcCount ( ) const
inlinenodiscard
Here is the caller graph for this function:

◆ mainArcData()

const ArcVertex * EnergyTeslaArcEffect::mainArcData ( ) const
inlinenodiscard

◆ rerandomizeBranches()

void EnergyTeslaArcEffect::rerandomizeBranches ( Beam & beam)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ safeNormalize()

glm::vec3 EnergyTeslaArcEffect::safeNormalize ( glm::vec3 v,
glm::vec3 fallback )
staticnodiscardprivate
Here is the caller graph for this function:

◆ smooth01()

float EnergyTeslaArcEffect::smooth01 ( float v)
staticnodiscardprivate
Here is the caller graph for this function:

◆ update()

void EnergyTeslaArcEffect::update ( float dt,
glm::vec3 camForward )
Here is the call graph for this function:

Member Data Documentation

◆ beams_

std::array<Beam, k_maxBeams> EnergyTeslaArcEffect::beams_ {}
private

◆ debugKey_

uint32_t EnergyTeslaArcEffect::debugKey_ = 0xEA11u
private

◆ debugPreviewKey_

uint32_t EnergyTeslaArcEffect::debugPreviewKey_ = 0xEA10u
private

◆ detailArcVerts_

std::vector<ArcVertex> EnergyTeslaArcEffect::detailArcVerts_
private

◆ k_branchRetime

float EnergyTeslaArcEffect::k_branchRetime = 0.045f
staticconstexprprivate

◆ k_branchSegs

int EnergyTeslaArcEffect::k_branchSegs = 7
staticconstexprprivate

◆ k_fadeTime

float EnergyTeslaArcEffect::k_fadeTime = 0.08f
staticconstexprprivate

◆ k_mainSegs

int EnergyTeslaArcEffect::k_mainSegs = 32
staticconstexprprivate

◆ k_maxBeams

int EnergyTeslaArcEffect::k_maxBeams = 8
staticconstexprprivate

◆ k_maxBranches

int EnergyTeslaArcEffect::k_maxBranches = 8
staticconstexprprivate

◆ k_maxStrands

int EnergyTeslaArcEffect::k_maxStrands = 3
staticconstexprprivate

◆ mainArcVerts_

std::vector<ArcVertex> EnergyTeslaArcEffect::mainArcVerts_
private

The documentation for this class was generated from the following files: