Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "Headers/pxShapeScaling.h"

#include "Core/Math/Headers/Transform.h"
#include "Dynamics/Physics/Headers/PXDevice.h"
#include "Dynamics/Physics/PhysX/Headers/PhysXSceneInterface.h"

using namespace physx;

namespace Divide {

bool PhysX::createPlane(const vec3<F32>& position, U32 size){
    assert(_targetScene != nullptr);

    PxRigidStatic* plane = PxCreatePlane(*_gPhysicsSDK,PxPlane(PxVec3(0,1,0),position.y),
                                         *(static_cast<PhysXSceneInterface* >(_targetScene)->getMaterials()[1]));
    /*plane->setGlobalPose(PxTransform(PxVec3(position.x,position.y,position.z), 
                                     PxQuat(RADIANS(90), PxVec3(1,0,0))));*/

    if (!plane){
        ERROR_FN(Locale::get("ERROR_PHYSX_CREATE_PLANE"));
        return false;
    }

    PhysXActor* actorWrapper = MemoryManager_NEW PhysXActor();
    actorWrapper->_type = PxGeometryType::ePLANE;
    actorWrapper->_actor = plane;
    actorWrapper->_isDynamic = false;
    actorWrapper->_userData = (F32)size;
    static_cast<PhysXSceneInterface* >(_targetScene)->addRigidActor(actorWrapper);
    return true;
}

bool PhysX::createBox(const vec3<F32>& position, F32 size){
    assert(_targetScene != nullptr);
    PxReal density = 1.0f;
    PxTransform transform(PxVec3(position.x, position.y, position.z), PxQuat(PxIdentity));
    PxVec3 dimensions(size);
    PxBoxGeometry geometry(dimensions);
    PxRigidDynamic *actor = PxCreateDynamic(*_gPhysicsSDK,
                                             transform,
                                             geometry,
                                             *(static_cast<PhysXSceneInterface* >(_targetScene)->getMaterials()[1]),
                                             density);
    actor->setAngularDamping(0.75);
    actor->setLinearVelocity(PxVec3(0));

    if (!actor){
        ERROR_FN(Locale::get("ERROR_PHYSX_CREATE_BOX"));
        return false;
    }

    PhysXActor* actorWrapper = MemoryManager_NEW PhysXActor();
    actorWrapper->_type = PxGeometryType::eBOX;
    actorWrapper->_actor = actor;
    actorWrapper->_isDynamic = true;
    actorWrapper->_userData = size * 2;
    static_cast<PhysXSceneInterface* >(_targetScene)->addRigidActor(actorWrapper);
    return true;
}

};

Commits for Divide-Framework/trunk/Source Code/Dynamics/Physics/PhysX/Actors/pxSimpleShapes.cpp

Diff revisions: vs.
Revision Author Commited Message
331 Diff Diff IonutCava picture IonutCava Sat 06 Dec, 2014 20:53:45 +0000

[Ionut]
- Limited line length to 132 characters to improve readability and diff-comparisons
- Refactored memory allocation/deallocation functions
- Fixed a few compatibility issues with HashMap.h
- Fixed a bug in GPU Skinning shaders (cast a float to int)

318 Diff Diff IonutCava picture IonutCava Sat 30 Aug, 2014 17:35:53 +0000

[Ionut]
- Wrapped the entire code in a “Divide” namespace
- VertexBuffers now call “shrink_to_fit” on all internal data storage
- Improved some vector performance by preferring “emplace_back” instead of “push_back” + proepr usage of reserve / resize
- Wrapped OIS specific types and classes in Divide::Input namespace
- Added the messageBox.layout file (forgot it in the previous few commits)

251 Diff Diff k1ngp1n picture k1ngp1n Wed 02 Apr, 2014 20:38:18 +0000

[Ionut] [[BR]]

  • Divide is now a 64bit statically linked application * [[BR]]

- Updated to a Visual Studio 2013 solution for better C++11 support [[BR]]
— Recompiled all projects with platform toolset v120 [[BR]]
- Recompiled all projects as x64 – MT / MTd (from x86 – MD / MDd) [[BR]]
- Updated PhysX to 3.3 [[BR]]
- Updated GLFW to 3.0.4 [[BR]]

249 Diff Diff k1ngp1n picture k1ngp1n Mon 31 Mar, 2014 20:42:31 +0000

[Ionut] [[BR]]
- Migrated to platform toolset v100 [[BR]]
- Updated boost to 1.55 [[BR]]
- Moved from “NULL” to “nullptr” [[BR]]
- DevIL is now linked dynamically [[BR]]

187 Diff Diff k1ngp1n picture k1ngp1n Tue 26 Nov, 2013 22:43:17 +0000

[Ionut][[BR]]
- PhysX fixes [[BR]]
- Part one of instancing support (model matrices are now stored in stacks) [[BR]]
- Added more game rules to AITenisScene [[BR]]

175 Diff Diff k1ngp1n picture k1ngp1n Sun 10 Nov, 2013 18:48:48 +0000

- PhysX triangle mesh cooking fully working [[BR]]
- Simplified PhysXSceneInterface implementation [[BR]]

171 Diff Diff k1ngp1n picture k1ngp1n Sun 03 Nov, 2013 18:15:06 +0000

-Replaced all tabs with spaces [[BR]]

152 Diff Diff k1ngp1n picture k1ngp1n Thu 20 Jun, 2013 14:23:31 +0000

[Ionut] [[BR]]
- New rendering pipeline (experimental and unstable): [[BR]]
— OpenGL 3.x clean context (glLight commands are still used for now, but UBO support is there, but not used yet) [[BR]]
— Custom matrix stacks and UBO based shader data (UBOs cause some link errors on some nVidia cards)[[BR]]
— Multi-threaded texture loading and shader compilation (mt shader compilation disabled for now. needs more tests) [[BR]]
— VAO rendering is self contained (no more enable/disable calls before a draw request) [[BR]]
— Render instance class used for rendering information [[BR]]
[[BR]]
- New unique ID generation base class: GUIDWrapper. Each class that derives from this, gets an application wide unique id on construction [[BR]]
- Added base code for an in-game editor using CEGUI [[BR]]
- Replaced some mutex locks with lockless data structures or atomic data [[BR]]
- CEGUI 0.8.2, FTGL-GL3 and GLIM 0.4 modified to support GLEW_MX if defined [[BR]]
- Dropped VS2008 support [[BR]]
- Networking library, server framework and ReCast files are now projects inside the Divide Framework solution [[BR]]
- New console command “setFov” that modifies the horizontal FoV value in realtime [[BR]]
- New console command “recompileShader” that reparses shader files, recompiles shaders and relinks shader programs who’s names match or contain the argument string [[BR]]
- New debug utility: axis angle drawn in corner of the screen if needed [[BR]]
- More ‘const’-s pasted around the code, more loop performance tweaks (allocations before a loop, tighter loops, etc), more utility member functions added to various classes [[BR]]

151 Diff Diff k1ngp1n picture k1ngp1n Tue 07 May, 2013 00:00:52 +0000

[Ionut] [[BR]]
- Better ReCast integration [[BR]]
— Any entity can be used as an obstacle in the NavMesh if that’s specified in each scene’s assets.xml file for said entity [[BR]]
— New console command, “createNavMesh”, that passes geometry data to ReCast [[BR]]
-— NavMesh generation is not yet complete [[BR]]
- Better PhysX integration [[BR]]
— Each scene passes data to and gets data from the Physics API better and safer[[BR]]
- Multi-threaded support extended: [[BR]]
— Event class replaced with Task [[BR]]
— Kernel uses a threadpool for scene tasks [[BR]]
— Each task can be added to a different threadpool if needed [[BR]]
— Most critical sections use the new boost::atomic wrapper for thread safety [[BR]]
- Rendering system updated [[BR]]
— VBO’s keep track of the geometry type internally [[BR]]
— Rendering by specific element list is internal to the VBO [[BR]]
— VBO’s can draw a “lite” version that doesn’t send Tangent, BiTangent and TexCoord data for depth rendering (disabled) [[BR]]
- Reflectors now offer a preview of the generated reflective texture if needed [[BR]]
- Buttons are now added and rendered by CEGUI [[BR]]
[[BR]]
Deprecation: [[BR]]
- Removed fixed pipeline material system [[BR]]
- Removed BoundingBox late update system [[BR]]
- Shadow references in the material system are now depth references [[BR]]
[[BR]]
Bug fixes: [[BR]]
- Problematic FBO double bind check removed [[BR]]
- Faster terrain rendering via chunk size selection through each scene’s terrain.xml[[BR]]
- Rendering is paused when the window is minimized [[BR]]
- CEGUI and impostors now render properly in deferred rendering mode [[BR]]
- Fixed various level 4 (VS2008) warnings [[BR]]
- Better state management and cleaning [[BR]]
- Better SceneGraph node management and trasformation/AABB update calls [[BR]]
- AITenisScene has proper collisions now [[BR]]

121 k1ngp1n picture k1ngp1n Sun 10 Jun, 2012 16:40:45 +0000

[Ionut] [[BR]]
-Added basic localization support [[BR]]
-Added cross-platform INI parsing [[BR]]
-Moved ReCast+Detour to LIBS folder [[BR]]