AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
CustomGravityField.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#ifndef AGX_CUSTOMGRAVITYFIELD_H
18#define AGX_CUSTOMGRAVITYFIELD_H
19
20#include <agx/GravityField.h>
21
22namespace agx
23{
24
35 {
36 public:
39
47 virtual agx::Vec3 calculateGravity(const agx::Vec3& position) const override;
48
49 public:
51 virtual Task* createRigidBodyTask() override;
52
54 virtual Task* createParticleSystemTask() override;
55
57
58 private:
59
60 protected:
63
64 virtual void store(agxStream::OutputArchive& out) const override;
65 virtual void restore( agxStream::InputArchive& in ) override;
66 };
68
69} //namespace agx
70
71
72#endif
#define AGX_DECLARE_POINTER_TYPES(type)
Definition Referenced.h:254
#define AGXPHYSICS_EXPORT
Class for reading a binary stream of serialized data.
Class for writing serialized data in binary format to a stream.
The custom gravity field allow a user to derive from this class and implement their own gravity funct...
virtual void restore(agxStream::InputArchive &in) override
virtual ~CustomGravityField()
Destructor.
virtual agx::Vec3 calculateGravity(const agx::Vec3 &position) const override
Given position, a gravity acceleration will be calculated and returned.
virtual Task * createParticleSystemTask() override
Internal use.
CustomGravityField()
Constructor.
virtual Task * createRigidBodyTask() override
Internal use.
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(agx::CustomGravityField)
virtual void store(agxStream::OutputArchive &out) const override
The class GravityField is responsible for calculating and applying a gravity force on a set of bodies...
A representation of a generic task.
Definition Task.h:58
The agx namespace contains the dynamics/math part of the AGX Dynamics API.