~ubuntu-branches/ubuntu/precise/rss-glx/precise

« back to all changes in this revision

Viewing changes to reallyslick/include/Implicit/impShape.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2009-06-03 18:41:32 UTC
  • mfrom: (1.1.5 upstream) (2.2.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090603184132-znjy66pq9xom7hac
Tags: 0.9.0-2ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop dependency on openal. It is not enabled by default anyway, and
    allows openal to migrate to universe.
  - src/skyrocket.{cpp,xml}: Disable sound by default.
  - Add --disable-sound configure flag to debian/rules, as we don't keep 
    the dependencies on openal nor freeglut (both universe packages).
* Dropped changes, merged upstream:
  - other_src/Makefile.am: fix the upstream build rules to actually use
    the ImageMagick CFLAGS returned by pkg-config.
  - Move the unconditional ImageMagick check up in configure.in so that
    our first PKG_CHECK_MODULES() call isn't hidden behind a shell
    conditional.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2001-2005  Terence M. Welsh
3
 
 *
4
 
 * This file is part of Implicit.
5
 
 *
6
 
 * Implicit is free software; you can redistribute it and/or
7
 
 * modify it under the terms of the GNU Lesser General Public
8
 
 * License version 2.1 as published by the Free Software Foundation.
9
 
 *
10
 
 * Implicit is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU Lesser General Public
16
 
 * License along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
 
 */
19
 
 
20
 
 
21
 
#ifndef IMPSHAPE_H
22
 
#define IMPSHAPE_H
23
 
 
24
 
 
25
 
// This is a generic class from which specific elements are
26
 
// derived.  An element would be a sphere or torus or anything
27
 
// that defines an implicit surface.
28
 
 
29
 
 
30
 
#include <Implicit/impCrawlPoint.h>
31
 
#include <math.h>
32
 
 
33
 
 
34
 
class impShape{
35
 
public:
36
 
        float mat[16];
37
 
        float invmat[16];
38
 
        // Thickness is only necessary in torii and knots, but can be used in other shapes.
39
 
        // Thickness is different from scale (which can be applied using an element's
40
 
        // matrix) because it only scales the width of appendages and not their relative
41
 
        // distances.
42
 
        // thicknessSquared is often useful in the value() function, so it is precomputed.
43
 
        float thickness, thicknessSquared;
44
 
 
45
 
        impShape();
46
 
        virtual ~impShape(){};
47
 
        void setPosition(float x, float y, float z);
48
 
        void setPosition(float* position);
49
 
        void setMatrix(float* m);
50
 
        void invertMatrix();
51
 
        void setThickness(float t){
52
 
                thickness = t;
53
 
                thicknessSquared = thickness * thickness;
54
 
        }
55
 
        float getThickness(){return thickness;}
56
 
        // returns the value of this element at a given position
57
 
        // "position" is an array of 3 floats
58
 
        virtual float value(float* position);
59
 
        // assigns a center of the element's volume to "position"
60
 
        virtual void center(float* position);
61
 
        // adds surface crawler start position(s) to given crawlPointVector
62
 
        virtual void addCrawlPoint(impCrawlPointVector &cpv);
63
 
};
64
 
 
65
 
 
66
 
 
67
 
 
68
 
#endif