projects
/
hair
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Failed hack for collision detection with a sphere.
[hair]
/
src
/
hair.h
diff --git
a/src/hair.h
b/src/hair.h
index
be979ee
..
9ef5130
100644
(file)
--- a/
src/hair.h
+++ b/
src/hair.h
@@
-4,12
+4,11
@@
#include <gmath/gmath.h>
#include "mesh.h"
#include <gmath/gmath.h>
#include "mesh.h"
+#include "object.h"
struct HairStrand {
Vec3 pos;
Vec3 velocity;
struct HairStrand {
Vec3 pos;
Vec3 velocity;
- /* directions relative to the spawn point */
- Vec3 anchor_dirs[3];
Vec3 spawn_pt;
Vec3 spawn_dir;
};
Vec3 spawn_pt;
Vec3 spawn_dir;
};
@@
-18,6
+17,8
@@
class Hair {
private:
float hair_length;
std::vector<HairStrand> hair;
private:
float hair_length;
std::vector<HairStrand> hair;
+ Mat4 xform;
+ std::vector<CollSphere *> colliders;
public:
Hair();
public:
Hair();
@@
-25,6
+26,11
@@
public:
bool init(const Mesh *m, int num_spawns, float thresh = 0.4);
void draw() const;
bool init(const Mesh *m, int num_spawns, float thresh = 0.4);
void draw() const;
+
+ void set_transform(Mat4 &xform);
+ void update(float dt);
+ void add_collider(CollSphere *cobj);
+ Vec3 handle_collision(const Vec3 &v) const;
};
#endif //PARTICLES_H_
};
#endif //PARTICLES_H_