Choreonoid  1.8
SpotLight.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_SPOT_LIGHT_H
7 #define CNOID_BODY_SPOT_LIGHT_H
8 
9 #include "PointLight.h"
10 #include "exportdecl.h"
11 
12 namespace cnoid {
13 
14 class CNOID_EXPORT SpotLight : public PointLight
15 {
16 public:
17  SpotLight();
18  SpotLight(const SpotLight& org, bool copyStateOnly = false);
19 
20  virtual const char* typeName() const override;
21  void copyStateFrom(const SpotLight& other);
22  virtual void copyStateFrom(const DeviceState& other) override;
23  virtual DeviceState* cloneState() const override;
24  virtual void forEachActualType(std::function<bool(const std::type_info& type)> func) override;
25  virtual int stateSize() const override;
26  virtual const double* readState(const double* buf) override;
27  virtual double* writeState(double* out_buf) const override;
28 
29  const Vector3& direction() const { return direction_; }
30  void setDirection(const Vector3& direction) { direction_ = direction; }
31 
32  float beamWidth() const { return beamWidth_; }
33  void setBeamWidth(float beamWidth) { beamWidth_ = beamWidth; }
34 
35  float cutOffAngle() const { return cutOffAngle_; }
36  void setCutOffAngle(float angle) { cutOffAngle_ = angle; }
37 
38  float cutOffExponent() const { return cutOffExponent_; }
39  void setCutOffExponent(float e) { cutOffExponent_ = e; }
40 
41  bool readSpecifications(const Mapping* info);
42  bool writeSpecifications(Mapping* info) const;
43 
44 protected:
45  virtual Referenced* doClone(CloneMap* cloneMap) const override;
46 
47 private:
48  Vector3 direction_;
49  float beamWidth_;
50  float cutOffAngle_;
51  float cutOffExponent_;
52 };
53 
55 
56 }
57 
58 #endif
cnoid::Mapping
Definition: ValueTree.h:253
cnoid::SpotLight::direction
const Vector3 & direction() const
Definition: SpotLight.h:29
PointLight.h
cnoid::SpotLight::setBeamWidth
void setBeamWidth(float beamWidth)
Definition: SpotLight.h:33
cnoid::Vector3
Eigen::Vector3d Vector3
Definition: EigenTypes.h:57
cnoid::SpotLight::setCutOffExponent
void setCutOffExponent(float e)
Definition: SpotLight.h:39
cnoid::SpotLight::cutOffAngle
float cutOffAngle() const
Definition: SpotLight.h:35
cnoid::SpotLight::setCutOffAngle
void setCutOffAngle(float angle)
Definition: SpotLight.h:36
cnoid::SpotLight
Definition: SpotLight.h:14
cnoid::ref_ptr
Definition: Referenced.h:103
cnoid::SpotLightPtr
ref_ptr< SpotLight > SpotLightPtr
Definition: SpotLight.h:54
cnoid::SpotLight::cutOffExponent
float cutOffExponent() const
Definition: SpotLight.h:38
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::CloneMap
Definition: CloneMap.h:13
cnoid::SpotLight::beamWidth
float beamWidth() const
Definition: SpotLight.h:32
cnoid::DeviceState
Definition: Device.h:20
cnoid::SpotLight::setDirection
void setDirection(const Vector3 &direction)
Definition: SpotLight.h:30
cnoid::Referenced
Definition: Referenced.h:54
cnoid::PointLight
Definition: PointLight.h:16