Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed octet compiling on mac using make file #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion octet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ else
endif
ifeq ($(UNAME_S),Darwin)
CC = clang
CCFLAGS += -g -O2 -Wswitch -D OCTET_MAC -F/System/Library/Frameworks -framework GLUT -framework OpenGL -framework OpenAL -lstdc++ -DOCTET_PREFIX=\"\" -Iopen_source/bullet
CCFLAGS += -g -O2 -Wswitch -D OCTET_MAC -F/System/Library/Frameworks -framework GLUT -framework OpenGL -framework OpenAL -lstdc++ -std=c++11 -DOCTET_PREFIX=\"\" -Iopen_source/bullet
endif
endif

Expand Down
14 changes: 7 additions & 7 deletions octet/src/scene/mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace octet { namespace scene {

// add a new edge to a hash map. (index, index) -> (triangle+1, triangle+1)
static void add_edge(dynarray<edge> &edges, unsigned tri_idx, unsigned i0, unsigned i1) {
edge e = { std::min(i0, i1), std::max(i0, i1), tri_idx, ~0 };
edge e = { static_cast<int32_t> (std::min(i0,i1)), static_cast<int32_t> (std::max(i0, i1)), static_cast<int32_t> (tri_idx), ~0 };
edges.push_back(e);
}

Expand Down Expand Up @@ -383,13 +383,13 @@ namespace octet { namespace scene {
// note that it is your responsibility to deallocate resources!
btIndexedMesh mesh;
mesh.m_numTriangles = get_num_indices() / 3;
mesh.m_triangleIndexBase = (const unsigned char *)malloc(get_indices()->get_size());
mesh.m_triangleIndexStride = sizeof(uint32_t) * 3;
mesh.m_triangleIndexBase = (const unsigned char *)malloc(get_indices()->get_size());
mesh.m_triangleIndexStride = sizeof(uint32_t) * 3;
mesh.m_numVertices = get_num_vertices();
mesh.m_vertexBase = (const unsigned char *)malloc(get_vertices()->get_size());
mesh.m_vertexStride = get_stride();

{
mesh.m_vertexBase = (const unsigned char *)malloc(get_vertices()->get_size());
mesh.m_vertexStride = get_stride();
{
gl_resource::rolock idx_lock(get_indices());
gl_resource::rolock vtx_lock(get_vertices());
memcpy((void*)mesh.m_triangleIndexBase, idx_lock.u8() + get_index_size() * first_index, get_indices()->get_size());
Expand Down
2 changes: 1 addition & 1 deletion octet/src/scene/scene_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ namespace octet { namespace scene {
btVector3 vel = rigid_body->getLinearVelocity();
float s2 = vel.dot(vel);
if (s2 > max_speed * max_speed) {
rigid_body->setLinearVelocity(vel * (max_speed/std::sqrt(s2)));
rigid_body->setLinearVelocity(vel * (max_speed/sqrt(s2)));
}
}
#endif
Expand Down