VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtDropParticle.h
Go to the documentation of this file.
1 /*****************************************************************************
2 * Copyright (c) 2021 MAK Technologies, Inc.
3 * All rights reserved.
4 *****************************************************************************/
5 
6 #pragma once
7 
11 
15 
19 
20 #include <vector>
21 
22 namespace makVrv
23 {
26  {
27  public:
29  DtDropParticle(float px, float py, float pMass, double time,
30  DtGridCell grid[][GRID_DIMENSION]);
31 
33  virtual ~DtDropParticle();
34  private:
36  DtDropParticle() = delete;
37 
39  DtDropParticle(const DtDropParticle&) = delete;
40 
42  DtDropParticle& operator=(const DtDropParticle&) = delete;
43  public:
44 
47  virtual void setParent(DtDropParticle *drop);
48  virtual DtDropParticle *parent() const;
49 
51  virtual float mass() const;
52  virtual void setMass(float m);
53 
55  virtual const Vector2_32& velocity() const;
56 
58  virtual void affectedCells(std::vector< DtVector2<short> >& cells) const;
59 
61  virtual void computeRadius(double waterOnScreenSize);
62 
64  virtual void update(double time, double elapsedTime,
65  DtGridCell grid[][GRID_DIMENSION],
66  bool& destroyFlag) = 0;
67 
69  virtual void gridPosition(int& gx, int& gy) const;
70 
72  virtual bool mergeable() const;
73 
75  virtual float x() const;
76 
78  virtual float y() const;
79 
81  virtual float radius() const;
82 
84  virtual int type() const;
85 
87  virtual float intensity(void) const;
88  public:
91 
94  static const void* precomputedDropletNormalsDataPointer(void);
95 
96  protected:
97 
98  float myX, myY, myRadius, myMass, myV0;
99 
100  double myT0;
103 
106 
108 
109  protected:
111 
112  static bool myDropletInitialized;
113  };
114 
115 }
double myT0
Definition: DtDropParticle.h:100
DtDropParticle()=delete
private default constructor. not allowed.
virtual void gridPosition(int &gx, int &gy) const
get the grid position
float myX
Definition: DtDropParticle.h:98
virtual int type() const
type (0)
2 dimensional vector
static bool myDropletInitialized
Definition: DtDropParticle.h:112
static void precomputeDropletNormalsIfNeeded()
Precompute a normal map for a drop.
bool myMergeable
Definition: DtDropParticle.h:107
float myAcceleration
Definition: DtDropParticle.h:101
int myLastGridY
Definition: DtDropParticle.h:105
static DtVector4< unsigned int > thePrecomputedDropletNormals[PRECOMPUTED_DIM][PRECOMPUTED_DIM]
Definition: DtDropParticle.h:110
int myLastGridX
Definition: DtDropParticle.h:105
virtual float intensity(void) const
intensity (1)
4 dimensional vector
virtual float x() const
get x
virtual void affectedCells(std::vector< DtVector2< short > > &cells) const
Gets all screen grid cells covered by this drop.
virtual ~DtDropParticle()
destructor
3 dimensional vector
virtual void update(double time, double elapsedTime, DtGridCell grid[][GRID_DIMENSION], bool &destroyFlag)=0
Update the particle.
DtDropParticle & operator=(const DtDropParticle &)=delete
prevent assignment
float myY
Definition: DtDropParticle.h:98
virtual const Vector2_32 & velocity() const
get the velocity
Vector2_32 myVelocity
Definition: DtDropParticle.h:104
Vector2_32 myDirection
Definition: DtDropParticle.h:104
float myMass
Definition: DtDropParticle.h:98
virtual void computeRadius(double waterOnScreenSize)
compute radius
DtDropParticle * myParent
Definition: DtDropParticle.h:102
virtual float y() const
get y
Internal struct for one cell of our grid of glass properties.
Definition: DtGridCell.h:19
#define GRID_DIMENSION
Definition: DtWaterOnScreenDefines.h:56
Local class for a single drop particle on the screen.
Definition: DtDropParticle.h:25
Contains DLL export macros.
virtual void setMass(float m)
virtual float radius() const
get radius
virtual void setParent(DtDropParticle *drop)
If this drop was left behind from wetting from another drop, keep track of the parent drop...
Contains makVrv::DtGridCell struct.
float myV0
Definition: DtDropParticle.h:98
static const void * precomputedDropletNormalsDataPointer(void)
accesss the grid of precomputed normals as a void* pointer (so that they can be copied into a gpu buf...
float myRadius
Definition: DtDropParticle.h:98
#define PRECOMPUTED_DIM
Definition: DtWaterOnScreenDefines.h:42
virtual float mass() const
set/get the mass
virtual DtDropParticle * parent() const
virtual bool mergeable() const
can this be merged with another particle?

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)