AGX Dynamics  2.38.0.2
GravityField.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 #include <agx/Component.h>
20 #include <agx/Vec3.h>
21 
22 #include <agxStream/Serializable.h>
23 
24 namespace agx
25 {
26  class Task;
27 
38  {
39  public:
40  GravityField();
41 
47  virtual agx::Vec3 calculateGravity( const agx::Vec3& position ) const = 0;
48 
49  public:
51  virtual Task* createRigidBodyTask() = 0;
52 
54  virtual Task* createParticleSystemTask() = 0;
55 
57 
58  protected:
59  virtual void store( agxStream::OutputArchive& out ) const override;
60  virtual void restore( agxStream::InputArchive& in ) override;
61 
63  virtual ~GravityField();
64  };
65 
66 } //namespace agx
67 
agxStream::out
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive.
Definition: OutputArchive.h:412
agxStream::Serializable
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
Definition: Serializable.h:221
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agxStream::in
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
Definition: InputArchive.h:399
agx::Task
A representation of a generic task.
Definition: Task.h:57
Vec3.h
Component.h
agxStream::OutputArchive
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:56
Serializable.h
agx::Component
A component is an object containing other objects, enabling hierarchical structuring.
Definition: Component.h:38
agxStream::InputArchive
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:50
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agx::Vec3T< Real >
agx::GravityField
The class GravityField is responsible for calculating and applying a gravity force on a set of bodies...
Definition: GravityField.h:37